Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ashi009 committed Oct 4, 2019
1 parent f923f3e commit d2bd4db
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -4,5 +4,4 @@ node_js:
- "10"
- "8"
- "6"
- "5"
after_success: yarn run coverage
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -44,7 +44,9 @@ js_crc32 for inputs 16836819B, avg 2055B x 24.82 ops/sec ±1.70% (45 runs sample
## Install

```shell
npm install fast-crc32c --save
npm install fast-crc32c@^1.1.0 --save
# For node version before 6
# npm install fast-crc32c@^1.0.0 --save
```

### Usage
Expand Down
3 changes: 1 addition & 2 deletions benchmark/index.js
@@ -1,4 +1,3 @@
const util = require('util');
const Benchtable = require('benchtable');

const suite = new Benchtable();
Expand Down Expand Up @@ -29,7 +28,7 @@ const k1kBuffer = [generateBuffer(1024)];
const k4kBuffers = generateBuffers(4096);

suite.addInput('1024B', [k1kBuffer]);
suite.addInput(util.format('%dB, avg %dB', k4kBuffers.totalSize, parseInt(k4kBuffers.averageSize)),
suite.addInput(`${k4kBuffers.totalSize}B, avg ${Math.trunc(k4kBuffers.averageSize)}B`,
[k4kBuffers]);

suite.on('cycle', function(event) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "fast-crc32c",
"description": "CRC32C algorithm with hardware acceleration and software fallback.",
"version": "1.0.6",
"version": "2.0.0",
"author": "Xiaoyi Shi <ashi009@gmail.com>",
"license": "MIT",
"repository": {
Expand Down
6 changes: 2 additions & 4 deletions test/crc32c.js
@@ -1,5 +1,3 @@
const util = require('util');

const sets = require('./sets.json');

sets.buffer.cases.forEach(function(cs) {
Expand All @@ -19,11 +17,11 @@ function testCalculate(crc32) {
for (const type in sets) {
const set = sets[type];
set.cases.forEach(function(cs) {
it(util.format('should digest %j correctly', cs.input), function() {
it(`should digest "${cs.input}" correctly`, function() {
crc32.calculate(cs.input).should.eql(cs.want);
});
});
it(util.format('should digest all %s correctly', type), function() {
it(`should digest all ${type} correctly`, function() {
set.cases.reduce(function(prev, cs) {
return crc32.calculate(cs.input, prev);
}, 0).should.eql(set.want);
Expand Down

0 comments on commit d2bd4db

Please sign in to comment.