Searched refs:sha1 (Results 1 – 2 of 2) sorted by relevance
127 byte[] sha1 = new byte[20]; in testGetSmallSha1()130 assertEquals(0, Utility.getSmallHashFromSha1(sha1)); in testGetSmallSha1()132 for (int i = 0; i < sha1.length; i++) { in testGetSmallSha1()133 sha1[i] = (byte) 0xFF; in testGetSmallSha1()135 assertEquals(Integer.MAX_VALUE, Utility.getSmallHashFromSha1(sha1)); in testGetSmallSha1()139 sha1[19] = (byte) i; in testGetSmallSha1()140 Utility.getSmallHashFromSha1(sha1); in testGetSmallSha1()
486 /* package for testing */ static int getSmallHashFromSha1(byte[] sha1) { in getSmallHashFromSha1() argument487 final int offset = sha1[19] & 0xf; // SHA1 is 20 bytes. in getSmallHashFromSha1()488 return ((sha1[offset] & 0x7f) << 24) in getSmallHashFromSha1()489 | ((sha1[offset + 1] & 0xff) << 16) in getSmallHashFromSha1()490 | ((sha1[offset + 2] & 0xff) << 8) in getSmallHashFromSha1()491 | ((sha1[offset + 3] & 0xff)); in getSmallHashFromSha1()