Searched refs:sha1 (Results 1 - 2 of 2) sorted by relevance

/packages/apps/Email/tests/src/com/android/emailcommon/utility/
H A DUtilityUnitTests.java127 byte[] sha1 = new byte[20];
130 assertEquals(0, Utility.getSmallHashFromSha1(sha1));
132 for (int i = 0; i < sha1.length; i++) {
133 sha1[i] = (byte) 0xFF;
135 assertEquals(Integer.MAX_VALUE, Utility.getSmallHashFromSha1(sha1));
139 sha1[19] = (byte) i;
140 Utility.getSmallHashFromSha1(sha1);
/packages/apps/Email/emailcommon/src/com/android/emailcommon/utility/
H A DUtility.java478 /* package for testing */ static int getSmallHashFromSha1(byte[] sha1) { argument
479 final int offset = sha1[19] & 0xf; // SHA1 is 20 bytes.
480 return ((sha1[offset] & 0x7f) << 24)
481 | ((sha1[offset + 1] & 0xff) << 16)
482 | ((sha1[offset + 2] & 0xff) << 8)
483 | ((sha1[offset + 3] & 0xff));

Completed in 54 milliseconds