1.0.7 • Published 2 years ago

@bunchtogether/hash-object v1.0.7

Weekly downloads
93
License
MIT
Repository
github
Last release
2 years ago

Hash Object

Hash Object CircleCI npm version codecov

Performant object hashing. Supports native maps, sets, classes, and typed arrays.

const { hash64, hash32 } = require('@bunchtogether/hash-object');

const a = hash64({a:1, b:2});
// typeof a === 'string'

const b = hash32([1,2,3]);
// typeof b === 'number'

Install

yarn add @bunchtogether/hash-object

Benchmarks

Complex Values

hash-object

  • Time: 1244ms (+409.84%)
  • Heap: 226Mb (+17.2%)

node-object-hash

  • Time: 663ms (+171.72%)
  • Heap: 220Mb (+13.86%)

hash-it

  • Time: 927ms (+279.92%)
  • Heap: 239Mb (+23.66%)

@bunchtogether/object-hash

  • Time: 244ms (+0%)
  • Heap: 193Mb (+0%)

Simple Values

hash-object

  • Time: 92ms (+8.24%)
  • Heap: 195Mb (+3.81%)

node-object-hash

  • Time: 99ms (+16.47%)
  • Heap: 196Mb (+4.41%)

hash-it

  • Time: 184ms (+116.47%)
  • Heap: 219Mb (+16.42%)

@bunchtogether/object-hash

  • Time: 85ms (+0%)
  • Heap: 188Mb (+0%)

API

Table of Contents