Files
BeWoPlaner/BeWoPlanerMobil/node_modules/utilise/hashcode.js

11 lines
231 B
JavaScript
Raw Normal View History

module.exports = function hashcode(str) {
var hash = 0
if (!str) return hash
for (var i = 0; i < str.length; i++) {
var char = str.charCodeAt(i)
hash = ((hash<<5)-hash)+char
hash = hash & hash
}
return hash
}