All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.globalize.src.util.string.hash.js Maven / Gradle / Ivy

The newest version!
define(function () {

// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery
    return function (str) {
        return [].reduce.call(str, function (hash, i) {
            var chr = i.charCodeAt(0);
            hash = ((hash << 5) - hash) + chr;
            return hash | 0;
        }, 0);
    };

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy