Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
The hash-sum npm package is used to create hash digests of JavaScript objects, arrays, strings, and other serializable values. It is a fast and dependency-free hashing function that generates a hex-encoded hash.
Hashing strings
This feature allows you to create a hash from a string. The hash is deterministic, meaning the same string will always result in the same hash.
"hashSum('Hello, World!')"
Hashing objects
You can hash JavaScript objects, which is useful for checking if objects have changed or for using objects as keys in caching mechanisms.
"hashSum({ key: 'value' })"
Hashing arrays
Arrays can also be hashed, which is helpful for creating unique identifiers for sets of items or for caching purposes.
"hashSum(['one', 'two', 'three'])"
Hashing other serializable values
The package can hash other serializable values such as numbers, ensuring a wide range of data types can be hashed.
"hashSum(12345)"
The md5 package is a JavaScript function for hashing messages with MD5. Unlike hash-sum, which is designed for hashing serializable JavaScript values, md5 is specifically focused on creating MD5 hashes of strings.
Crypto-js is a collection of cryptography algorithms implemented in JavaScript. It offers a variety of hash functions like SHA-1, SHA-256, and MD5. It is more feature-rich compared to hash-sum but also larger and with more dependencies.
Object-hash provides a complete hashing solution for JavaScript objects, supporting different algorithms like SHA-1 and MD5. It is similar to hash-sum but offers more options for customization and different hash algorithms.
blazing fast unique hash generator
npm i hash-sum -S
sum(value)
yields a four-byte hexadecimal hash based off of value
.
# creates unique hashes
00a34759 from: [ 0, 1, 2, 3 ]
a8996f0c from: { '0': 0, '1': 1, '2': 2, '3': 3 }
5b4c2116 from: { '0': 0, '1': 1, '2': 2, '3': 3, length: 4 }
2c937c45 from: { url: 12 }
31d55010 from: { headers: 12 }
2d2e11bc from: { headers: 122 }
ec99d958 from: { headers: '122' }
18c00eee from: { headers: { accept: 'text/plain' } }
6cb332c8 from: { payload: [ 0, 1, 2, 3 ], headers: [ { a: 'b' } ] }
12ff55db from: { a: [Function: a] }
46f806d2 from: { b: [Function: b] }
0660d9c4 from: { b: [Function: b] }
6c95fc65 from: function () {}
2941766e from: function (a) {}
294f8def from: function (b) {}
2d9c0cb8 from: function (a) { return a;}
ed5c63fc from: function (a) {return a;}
bba68bf6 from: ''
2d27667d from: 'null'
774b96ed from: 'false'
2d2a1684 from: 'true'
8daa1a0c from: '0'
8daa1a0a from: '1'
e38f07cc from: 'void 0'
6037ea1a from: 'undefined'
9b7df12e from: null
3c206f76 from: false
01e34ba8 from: true
8a8f9624 from: Infinity
0315bf8f from: -Infinity
64a48b16 from: NaN
1a96284a from: 0
1a96284b from: 1
29172c1a from: undefined
59322f29 from: {}
095b3a22 from: { a: {}, b: {} }
63be56dd from: { valueOf: [Function: valueOf] }
63be4f5c from: { valueOf: [Function: valueOf] }
5d844489 from: []
ba0bfa14 from: 2019-06-28T21:24:31.215Z
49324d16 from: 2019-06-28T03:00:00.000Z
434c9188 from: 1988-06-09T03:00:00.000Z
ce1b5e44 from: global
MIT
FAQs
Blazing fast unique hash generator
The npm package hash-sum receives a total of 2,601,275 weekly downloads. As such, hash-sum popularity was classified as popular.
We found that hash-sum demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.