Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meteor-it/utils-common

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meteor-it/utils-common - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

29

index.js

@@ -177,2 +177,29 @@ "use strict";

exports.hashCode = hashCode;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInV0aWxzLWNvbW1vbi9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGdDQUFnQztBQUNoQyx3QkFBK0IsR0FBRztJQUM5QixNQUFNLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEVBQUMsQ0FBQyxDQUFDLENBQUMsV0FBVyxFQUFFLEdBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN2RCxDQUFDO0FBRkQsd0NBRUM7QUFDRCxzQkFBNkIsQ0FBQyxFQUFFLENBQUM7SUFDN0IsRUFBRSxDQUFDLENBQUMsQ0FBQyxLQUFLLElBQUksSUFBSSxDQUFDLEtBQUssU0FBUyxJQUFJLENBQUMsS0FBSyxJQUFJLElBQUksQ0FBQyxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUM7UUFDakUsTUFBTSxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDbkIsQ0FBQztJQUNELEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxXQUFXLEtBQUssQ0FBQyxDQUFDLFdBQVcsQ0FBQyxDQUFDLENBQUM7UUFDbEMsTUFBTSxDQUFDLEtBQUssQ0FBQztJQUNqQixDQUFDO0lBQ0QsRUFBRSxDQUFDLENBQUMsQ0FBQyxZQUFZLFFBQVEsQ0FBQyxDQUFDLENBQUM7UUFDeEIsTUFBTSxDQUFDLENB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nQgZnVuY3Rpb24gY2IycHJvbWlzZSAoY2JGdW5jdGlvbikge1xuXHRyZXR1cm4gKC4uLmFyZ3MpID0+IHtcblx0XHRyZXR1cm4gbmV3IFByb21pc2UoKHJlcywgcmVqKSA9PiB7XG5cdFx0XHRjYkZ1bmN0aW9uKC4uLmFyZ3MsIChlcnIsIHJlc3VsdCkgPT4ge1xuXHRcdFx0XHRpZiAoZXJyKSByZXR1cm4gcmVqKGVycik7XG5cdFx0XHRcdHJlcyhyZXN1bHQpO1xuXHRcdFx0fSk7XG5cdFx0fSk7XG5cdH07XG59XG5leHBvcnQgZnVuY3Rpb24gaGFzaENvZGUocyl7XG4gICAgbGV0IGhhc2ggPSAwO1xuICAgIGlmIChzLmxlbmd0aCA9PSAwKSByZXR1cm4gaGFzaDtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgbGV0IGNoYXJhY3RlciA9IHMuY2hhckNvZGVBdChpKTtcbiAgICAgICAgaGFzaCA9ICgoaGFzaDw8NSktaGFzaCkrY2hhcmFjdGVyO1xuICAgICAgICBoYXNoID0gaGFzaCAmIGhhc2g7XG4gICAgfVxuICAgIHJldHVybiBoYXNoO1xufVxuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
function djb2Code(str) {
let hash = 5381;
for (let i = 0; i < str.length; i++) {
let char = str.charCodeAt(i);
hash = ((hash << 5) + hash) + char; /* hash * 33 + c */
}
return hash;
}
exports.djb2Code = djb2Code;
function sdbmCode(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
let char = str.charCodeAt(i);
hash = char + (hash << 6) + (hash << 16) - hash;
}
return hash;
}
exports.sdbmCode = sdbmCode;
function loseCode(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
let char = str.charCodeAt(i);
hash += char;
}
return hash;
}
exports.loseCode = loseCode;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInV0a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AgICAgIGxldCBjaGFyID0gc3RyLmNoYXJDb2RlQXQoaSk7XG4gICAgICAgIGhhc2ggPSBjaGFyICsgKGhhc2ggPDwgNikgKyAoaGFzaCA8PCAxNikgLSBoYXNoO1xuICAgIH1cbiAgICByZXR1cm4gaGFzaDtcbn1cbmV4cG9ydCBmdW5jdGlvbiBsb3NlQ29kZShzdHIpe1xuICAgIGxldCBoYXNoID0gMDtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHN0ci5sZW5ndGg7IGkrKykge1xuICAgICAgICBsZXQgY2hhciA9IHN0ci5jaGFyQ29kZUF0KGkpO1xuICAgICAgICBoYXNoICs9IGNoYXI7XG4gICAgfVxuICAgIHJldHVybiBoYXNoO1xufSJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==

2

package.json
{
"name": "@meteor-it/utils-common",
"version": "0.1.1",
"version": "0.1.2",
"description": "I",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc