Created
December 10, 2022 15:37
-
-
Save 0187773933/88d5d4a6f1a36db913df6cedbf25e932 to your computer and use it in GitHub Desktop.
Javascript - Quick Hash String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function quick_hash_string( input_string ) { | |
// https://stackoverflow.com/a/47617289 | |
return input_string.split('').map(v=>v.charCodeAt(0)).reduce((a,v)=>a+((a<<7)+(a<<3))^v).toString(16); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment