cylical-object-hash
Blake object hash.
Usage
const objectHash = require('cylical-object-hash')
let exampleObject = {
"@context": "http://schema.org",
"@type": "Book",
"copyrightHolder": {
"@type": "Organization",
"name": "Holt, Rinehart and Winston"
},
"copyrightYear": "2007",
"description": "NIMAC-sourced textbook",
"genre": "Educational Materials",
"inLanguage": "en-US",
"isFamilyFriendly": "true",
"isbn": "9780030426599",
"name": "Holt Physical Science",
"numberOfPages": "598",
"publisher": {
"@type": "Organization",
"name": "Holt, Rinehart and Winston"
}
}
objectHash.hex(exampleObject)
objectHash(exampleObject)
API
objectHash(obj)
This takes an ordinary object and will deterministically hash it via blake2b. It returns a Uint8Array by default.
.hex(obj)
This takes an ordinary object and will deterministically hash it via blake2b. Unlike the function above, it returns it as a hex string.
Installation
$ npm install cyclical-object-hash
License
MIT