public static int buildGUID(byte[] target, CharSequence host, int port, int userId) { //TODO: if we find a better hash for host port user we can avoid this trie lookup. TODO: performance improvement. // RABIN hash may be just the right thing. int pos = Pipe.copyUTF8ToByte(host, 0, target, Integer.MAX_VALUE, 0, host.length()); return finishBuildGUID(target, port, userId, pos); }
public static int buildGUID(byte[] target, byte[] hostBack, int hostPos, int hostLen, int hostMask, int port, int userId) { //TODO: if we find a better hash for host port user we can avoid this trie lookup. TODO: performance improvement. // RABIN hash may be just the right thing. Pipe.copyBytesFromToRing(hostBack, hostPos, hostMask, target, 0, Integer.MAX_VALUE, hostLen); int pos = hostLen; return finishBuildGUID(target, port, userId, pos); }