function objectHash(object, options){ options = applyDefaults(object, options); return hash(object, options); }
n/a
MD5 = function (object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex'}); }
...
*Sugar method, equivalent to hash(value, {algorithm: 'sha1'})*
## hash.keys(value);
Hash object keys using the sha1 algorithm, values ignored.
*Sugar method, equivalent to hash(value, {excludeValues: true})*
## hash.MD5(value);
Hash using the md5 algorithm.
*Sugar method, equivalent to hash(value, {algorithm: 'md5'})*
## hash.keysMD5(value);
Hash object keys using the md5 algorithm, values ignored.
...
keys = function (object){ return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'}); }
...
this['_' + objType](object);
} else if (options.ignoreUnknown) {
return write('[' + objType + ']');
} else {
throw new Error('Unknown object type "' + objType + '"');
}
}else{
var keys = Object.keys(object).sort();
// Make sure to incorporate special properties, so
// Types with different prototypes will produce
// a different hash and objects derived from
// different functions (`new Foo`, `new Bar`) will
// produce different hashes.
// We never do this for native functions since some
// seem to break because of that.
...
keysMD5 = function (object){ return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true}); }
...
*Sugar method, equivalent to hash(value, {excludeValues: true})*
## hash.MD5(value);
Hash using the md5 algorithm.
*Sugar method, equivalent to hash(value, {algorithm: 'md5'})*
## hash.keysMD5(value);
Hash object keys using the md5 algorithm, values ignored.
*Sugar method, equivalent to hash(value, {algorithm: 'md5', excludeValues: true})*
## hash.writeToStream(value, [options,] stream):
Write the information that would otherwise have been hashed to a stream, e.g.:
```js
...
sha1 = function (object){ return objectHash(object); }
...
* `respectType` {true|false} Whether special type attributes (`.prototype`, `.__proto__`, `.constructor`)
are hashed. default: true
* `unorderedArrays` {true|false} Sort all arrays using before hashing. Note that this affects *all* collections,
i.e. including typed arrays, Sets, Maps, etc. default: false
* `unorderedSets` {true|false} Sort `Set` and `Map` instances before hashing, i.e. make
`hash(new Set([1, 2])) == hash(new Set([2, 1]))` return `true`. default: true
## hash.sha1(value);
Hash using the sha1 algorithm.
*Sugar method, equivalent to hash(value, {algorithm: 'sha1'})*
## hash.keys(value);
Hash object keys using the sha1 algorithm, values ignored.
...
writeToStream = function (object, options, stream) { if (typeof stream === 'undefined') { stream = options; options = {}; } options = applyDefaults(object, options); return typeHasher(options, stream).dispatch(object); }
...
*Sugar method, equivalent to hash(value, {algorithm: 'md5'})*
## hash.keysMD5(value);
Hash object keys using the md5 algorithm, values ignored.
*Sugar method, equivalent to hash(value, {algorithm: 'md5', excludeValues: true})*
## hash.writeToStream(value, [options,] stream):
Write the information that would otherwise have been hashed to a stream, e.g.:
```js
hash.writeToStream({foo: 'bar', a: 42}, {respectType: false}, process.stdout)
// => e.g. 'object:a:number:42foo:string:bar'
```
## Installation
...