code: function encode(uri) {
      
      var prefix,
          protocolCode,
          encoded;
  
      // check each protocol, unless we've found a match
      // "urn:" is the one exception where we need to keep checking
      // slice so we don't check ""
      protocols.slice(1).forEach(function(protocol) {                        
          if ((!prefix || prefix === "urn:") && uri.indexOf(protocol) === 0) { 
              prefix = protocol;
          }
      });
  
      if (!prefix) {
          prefix = "";
      }
      
      encoded = util.stringToBytes(uri.slice(prefix.length));
      protocolCode = protocols.indexOf(prefix);    
      // prepend protocol code
      encoded.unshift(protocolCode);
      
      return encoded; 
  }
docs: shorten a URI with standard prefix @returns an array of bytes