Comparing version 0.1.6 to 0.1.7
{ | ||
"name": "adler32", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Adler-32 hashing algorithm", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -75,6 +75,23 @@ # adler32 [![Build Status](https://travis-ci.org/ChrisAckerman/adler32.svg?branch=master)](https://travis-ci.org/ChrisAckerman/adler32) | ||
## Transform Stream Usage | ||
Like the `crypto.Hash` class, `adler32.Hash` extends the `stream.Transform` class. You can use the stream `.write()` and | ||
`.read()` methods in place of the deprecated `.update()` and `.digest()` methods. See the | ||
[Node.js stream module](http://nodejs.org/api/stream.html) documentation for more information about streaming. | ||
`.read()` methods in place of the legacy `.update()` and `.digest()` methods. | ||
var hash = new adler32.Hash({ | ||
encoding: 'hex' // Sets the type of data returned by the read() method. Defaults to 'buffer'. | ||
}); | ||
// Write data to the stream in multiple chunks. | ||
hash.write('foo'); | ||
hash.write('bar'); | ||
// This is important! No data will be available for reading until end() is called. | ||
hash.end(); | ||
// Read should return a hexidecimal formatted string due to the encoding option being set to 'hex'. | ||
var hex_digest = hash.read(); | ||
See the [Node.js stream module](http://nodejs.org/api/stream.html) documentation for more information about streaming. | ||
## Caveats | ||
@@ -81,0 +98,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15768
133
0