Closed ashi009 closed 10 years ago
I think a good compromise would be to use Int32Array
if it exists, and fall back if it doesn't. So something like:
var CRC_TABLE = makeCRCTable();
//...
function makeCRCTable() {
var global = this;
var table = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, /*...*/];
if (global.Int32Array)
return new Int32Array(table);
return table;
}
That way it'll still work in all versions of node (and the browser, when browserified). Does that seem alright?
Cool, will update the patch
Awesome, thanks!
no problem!
v0.2.3
published.
Haven't tested on node 0.6, but added guard in package.json for that