crc
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -17,8 +17,11 @@ // Generated by CoffeeScript 1.7.1 | ||
CRC.prototype.each_byte = function(str, cb) { | ||
var char, _i, _len, _results; | ||
CRC.prototype.each_byte = function(buf, cb) { | ||
var byte, _i, _len, _results; | ||
if (typeof buf === 'string') { | ||
buf = new Buffer(buf); | ||
} | ||
_results = []; | ||
for (_i = 0, _len = str.length; _i < _len; _i++) { | ||
char = str[_i]; | ||
_results.push(cb(char.charCodeAt(0))); | ||
for (_i = 0, _len = buf.length; _i < _len; _i++) { | ||
byte = buf[_i]; | ||
_results.push(cb(byte)); | ||
} | ||
@@ -25,0 +28,0 @@ return _results; |
{ | ||
"name": "crc", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "CRC JavaScript implementation", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -50,2 +50,7 @@ # crc | ||
Or using a `Buffer`: | ||
crc.crc32(fs.readFileAsync('README.md')); | ||
# => "127ad531" | ||
Incrementally calculate a CRC32: | ||
@@ -52,0 +57,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
56739
356
115