299300301302303304305306307308309
UnsignedShort hash = new UnsignedShort("5381"); for (byte b : ba) { BigInteger bi = hash.bigIntegerValue(); hash = new UnsignedShort(bi.shiftLeft(5).add(bi).add(new BigInteger(Integer.toString(0xFF & b)))); } return hash; }