I am involved in the study of flowering filters, and I look at various hash functions in JavaScript.
For example, I found this in another stack overflow answer:
Found here qaru.site/questions/19682 / ... )
String.prototype.hashCode = function() {
var hash = 0, i, chr, len;
if (this.length == 0) return hash;
for (i = 0, len = this.length; i < len; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0;
}
return hash;
};
If I run:
String.prototype.call(null, "hello")
I get a numerical value: 99162322 (two other hash functions got me: 1335831723 and 120092131).
Now, if I create a hypothetical flowering filter with three hash functions and 18 indices (k = 3, m = 18), How are these large values ββindexed in an array with indices from 0-17?
source
share