Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: node-object-hash
node v9.11.2
version:
master
endpoint
share
tweet
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