(string: string)
| 1 | export default function hashString(string: string): string { |
| 2 | let hash = 0; |
| 3 | |
| 4 | for (const character of string) { |
| 5 | // eslint-disable-next-line no-bitwise -- Low-level hash function |
| 6 | hash = ((hash << 5) - hash) + character.codePointAt(0)!; |
| 7 | } |
| 8 | |
| 9 | return String(Math.trunc(hash)); |
| 10 | } |
no outgoing calls
no test coverage detected