MCPcopy Index your code
hub / github.com/totaljs/framework / string_hash

Function string_hash

utils.js:3458–3468  ·  view source on GitHub ↗
(s, convert)

Source from the content-addressed store, hash-verified

3456};
3457
3458function string_hash(s, convert) {
3459 var hash = 0;
3460 if (s.length === 0)
3461 return convert ? '' : hash;
3462 for (var i = 0, l = s.length; i < l; i++) {
3463 var char = s.charCodeAt(i);
3464 hash = ((hash << 5) - hash) + char;
3465 hash |= 0;
3466 }
3467 return hash;
3468}
3469
3470SP.count = function(text) {
3471 var index = 0;

Callers 1

utils.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected