snippetjavascriptCritical
Generate a Hash from string in Javascript
Viewed 0 times
fromgeneratehashstringjavascript
Problem
I need to convert strings to some form of hash. Is this possible in JavaScript?
I'm not utilizing a server-side language so I can't do it that way.
I'm not utilizing a server-side language so I can't do it that way.
Solution
`const generateHash = (string) => {
let hash = 0;
for (const char of string) {
hash = (hash
let hash = 0;
for (const char of string) {
hash = (hash
Context
Stack Overflow Q#7616461, score: 1087
Revisions (0)
No revisions yet.