({
globalObj = typeof global !== "undefined"
? global
: typeof window !== "undefined"
? window
: {},
random: rand = random,
} = {})
| 76 | on a random string. |
| 77 | */ |
| 78 | const createFingerprint = ({ |
| 79 | globalObj = typeof global !== "undefined" |
| 80 | ? global |
| 81 | : typeof window !== "undefined" |
| 82 | ? window |
| 83 | : {}, |
| 84 | random: rand = random, |
| 85 | } = {}) => { |
| 86 | const globals = Object.keys(globalObj).toString(); |
| 87 | const sourceString = globals.length |
| 88 | ? globals + createEntropy(bigLength, rand) |
| 89 | : createEntropy(bigLength, rand); |
| 90 | |
| 91 | return hash(sourceString).substring(0, bigLength); |
| 92 | }; |
| 93 | |
| 94 | const createCounter = (count) => () => { |
| 95 | return count++; |
no test coverage detected
searching dependent graphs…