(str, len, hashFunction)
| 26 | * @returns {string} hash |
| 27 | */ |
| 28 | const getHash = (str, len, hashFunction) => { |
| 29 | const hash = createHash(hashFunction); |
| 30 | hash.update(str); |
| 31 | const digest = hash.digest("hex"); |
| 32 | return digest.slice(0, len); |
| 33 | }; |
| 34 | |
| 35 | /** |
| 36 | * Returns string prefixed by an underscore if it is a number. |
no test coverage detected