Apex-Plugins/plugins/MoreAlts/PasswordUtils.js
2025-08-17 22:35:01 +02:00

12 lines
No EOL
299 B
JavaScript

function simpleHash(str) {
let hash = 0;
if (str.length === 0) return hash.toString();
for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i);
hash = ((hash << 5) - hash) + char;
hash = hash & hash;
}
return Math.abs(hash).toString(36);
}
export { simpleHash };