Skip to content

Commit f3ef163

Browse files
Use turbo-crc32 package to calcuclate crc32.
1 parent 89c048a commit f3ef163

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const crc = require('crc').crc32;
3+
const crc = require('turbo-crc32/crc32');
44

55
module.exports = {
66

@@ -32,6 +32,6 @@ module.exports = {
3232
},
3333

3434
hash(sess) {
35-
return crc(JSON.stringify(sess));
35+
return crc(JSON.stringify(sess)) >> 0; // eslint-disable-line no-bitwise
3636
},
3737
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
},
2828
"license": "MIT",
2929
"dependencies": {
30-
"crc": "^3.4.4",
3130
"debug": "^3.1.0",
3231
"is-type-of": "^1.0.0",
32+
"turbo-crc32": "^1.0.1",
3333
"uid-safe": "^2.1.3"
3434
},
3535
"engines": {

0 commit comments

Comments
 (0)