Created
February 24, 2022 11:53
-
-
Save gsimone/45a0b1ab37e3f29eb6a5af54e093c22d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hash = require('object-hash') | |
const sum = require('hash-sum') | |
const a = hash({ color: "red" }) | |
const b = hash({ color: "blue" }) | |
console.assert(a !== b) | |
const c = hash({ color: "red", opacity: 1 }, { unorderedObjects: true }) | |
const d = hash({ opacity: 1, color: "red" }, { unorderedObjects: true }) | |
console.log(c, d) | |
console.assert(c === d) | |
const e = sum({ color: "red", opacity: 1 }) | |
const f = sum({ opacity: 1, color: "red" }) | |
console.assert(e === f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment