From f3ef1638efa93f09bc479c814e3d1bf8b06eaed8 Mon Sep 17 00:00:00 2001 From: reklatsmasters Date: Sun, 16 Dec 2018 04:18:05 +0500 Subject: [PATCH] Use `turbo-crc32` package to calcuclate crc32. --- lib/util.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util.js b/lib/util.js index 2bdd7b8..a0445d3 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,6 +1,6 @@ 'use strict'; -const crc = require('crc').crc32; +const crc = require('turbo-crc32/crc32'); module.exports = { @@ -32,6 +32,6 @@ module.exports = { }, hash(sess) { - return crc(JSON.stringify(sess)); + return crc(JSON.stringify(sess)) >> 0; // eslint-disable-line no-bitwise }, }; diff --git a/package.json b/package.json index 319b103..72e37d8 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,9 @@ }, "license": "MIT", "dependencies": { - "crc": "^3.4.4", "debug": "^3.1.0", "is-type-of": "^1.0.0", + "turbo-crc32": "^1.0.1", "uid-safe": "^2.1.3" }, "engines": {