(string: string)
| 22 | |
| 23 | // fnv1a |
| 24 | export const getHash: typeof getHashDecl = (string: string): Hash => { |
| 25 | let hash = 0x811c9dc5; |
| 26 | arrayForEach(textEncoder.encode(string), (char) => { |
| 27 | hash ^= char; |
| 28 | hash += |
| 29 | (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24); |
| 30 | }); |
| 31 | return hash >>> 0; |
| 32 | }; |
| 33 | |
| 34 | export const addOrRemoveHash: typeof addOrRemoveHashDecl = ( |
| 35 | hash1: Hash, |
no test coverage detected
searching dependent graphs…