Hash Strings

JS
S
JavaScript

Function to generate number hashes from strings

1const hashCode = (s: string) => s.split('').reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);
2export { hashCode };
3

Created on 7/13/2021