Comparing version 0.1.2 to 0.1.3
@@ -20,2 +20,5 @@ "use strict" | ||
} | ||
// Make API chainable | ||
return this; | ||
}, | ||
@@ -22,0 +25,0 @@ digest: function(encoding) { |
{ | ||
"name": "fnv", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"author": "Sebastian Wiedenroth <wiedi@frubar.net>", | ||
@@ -20,2 +20,2 @@ "description": "Fowler–Noll–Vo hash implementation (FNV-1a 32-bit)", | ||
] | ||
} | ||
} |
@@ -17,5 +17,32 @@ # node-fnv | ||
## API | ||
### Class FNV | ||
##### new FNV() | ||
Create a new FNV hash object. | ||
##### fnv.update(data) | ||
- <code>data</code> Buffer or String (UTF-8 encoded) | ||
Updates the hash content with the given data. | ||
This can be called many times with new data. | ||
##### fnv.digest([encoding]) | ||
- <code>encoding</code> String - can be <code>'hex'</code>, <code>'binary'</code> or <code>'base64'</code> | ||
Returns the digest of all of the passed data to be hashed. | ||
If no encoding is provided <code>'binary'</code> is used. | ||
##### fnv.value() | ||
Returns the hash value as Number | ||
## References | ||
- <http://isthe.com/chongo/tech/comp/fnv/> | ||
- <http://tools.ietf.org/html/draft-eastlake-fnv-04> | ||
- <http://tools.ietf.org/html/draft-eastlake-fnv-06> |
@@ -8,2 +8,6 @@ "use strict" | ||
test('Chainable .update()', function(){ | ||
assert.equal(new FNV().update("foobar").digest("hex"), "bf9cf968"); | ||
}) | ||
test('#init', function(){ | ||
@@ -10,0 +14,0 @@ var h = new FNV() |
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
8805
163
48