Changeset 31343 in webkit for trunk/JavaScriptCore/wtf/HashFunctions.h
- Timestamp:
- Mar 26, 2008, 7:34:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/HashFunctions.h
r31335 r31343 36 36 37 37 // integer hash function 38 39 // Thomas Wang's 32 Bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm 40 inline unsigned intHash(uint8_t key8) 41 { 42 unsigned key = key8; 43 key += ~(key << 15); 44 key ^= (key >> 10); 45 key += (key << 3); 46 key ^= (key >> 6); 47 key += ~(key << 11); 48 key ^= (key >> 16); 49 return key; 50 } 51 52 // Thomas Wang's 32 Bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm 53 inline unsigned intHash(uint16_t key16) 54 { 55 unsigned key = key16; 56 key += ~(key << 15); 57 key ^= (key >> 10); 58 key += (key << 3); 59 key ^= (key >> 6); 60 key += ~(key << 11); 61 key ^= (key >> 16); 62 return key; 63 } 38 64 39 65 // Thomas Wang's 32 Bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm
Note:
See TracChangeset
for help on using the changeset viewer.