Skip to content

Commit a62f22a

Browse files
Update readme to detail passthrough mode. (#107)
This resolves issue #106 . I was looking for an algorithm option which would display the unhashed value, read the documentation, and assumed there wasn't one, without a more thorough look at the code. Once I inspected the code to make a pull request, I saw the feature already existed. The simple solution is to describe the feature in the appropriate place in the documentation of `hash()`.
1 parent 021c7f9 commit a62f22a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

readme.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ For more information, see [this discussion](https://github.com/puleos/object-has
3030

3131
## hash(value, options);
3232
Generate a hash from any object or type. Defaults to sha1 with hex encoding.
33-
* `algorithm` hash algo to be used: 'sha1', 'md5'. default: sha1
33+
* `algorithm` hash algo to be used: 'sha1', 'md5', 'passthrough'. default: sha1
3434
* This supports the algorithms returned by `crypto.getHashes()`. Note that the default of SHA-1 is not considered secure, and a stronger algorithm should be used if a cryptographical hash is desired.
35+
* This also supports the `passthrough` algorith, which will return the information that would otherwise have been hashed.
3536
* `excludeValues` {true|false} hash object keys, values ignored. default: false
3637
* `encoding` hash encoding, supports 'buffer', 'hex', 'binary', 'base64'. default: hex
3738
* `ignoreUnknown` {true|*false} ignore unknown object types. default: false

0 commit comments

Comments
 (0)