RunKit + npm: node-object-hash

node v9.11.2
version: master
endpointsharetweet
const assert = require('assert') const {hash, sort} = require('node-object-hash')() class Test { constructor(id) { this.id = id } toString() { return sort({ id: this.id }); } } const t1 = new Test(1) const t2 = new Test(2) const h1 = hash(t1) const h2 = hash(t2) assert.notEqual(h1, h2) console.log(h1, h2)
Created from: https://npm.runkit.com/node-object-hash
Loading…

no comments

    sign in to comment