Socket
Socket
Sign inDemoInstall

sse4_crc32

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sse4_crc32 - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

2

package.json

@@ -13,3 +13,3 @@ {

],
"version": "3.0.1",
"version": "3.1.0",
"author": "Anand Suresh <anandsuresh@gmail.com> (https://github.com/anandsuresh)",

@@ -16,0 +16,0 @@ "license":"MIT",

@@ -9,5 +9,5 @@ /**

var Sse4Crc32 = require("bindings")("sse4_crc32");
var isHardwareSupported = Sse4Crc32.isHardWareCrcSupported;
var calculate = isHardwareSupported ? hwCrc32c : swCrc32c;
/**

@@ -32,9 +32,8 @@ * Calculates CRC in software mode

*/
var hwCrc32c = isHardwareSupported ? function(input, initialCrc) {
function hwCrc32c(input, initialCrc) {
return Sse4Crc32.hwCrc(input, initialCrc || 0);
} : function() {
throw new Error('Hardware CRC-32C not supported!');
}
/**

@@ -61,3 +60,3 @@ * Defines a progressive CRC-32C calculator

Crc32C.prototype.update = function(input) {
this.crc32c = calculate(input, this.crc32c);
this.crc32c = module.exports.calculate(input, this.crc32c);
return this;

@@ -77,2 +76,3 @@ };

/**

@@ -83,3 +83,3 @@ * Export the required functions/classes

module.exports = {
isHardwareCrcSupported: isHardwareSupported,
isHardwareCrcSupported: Sse4Crc32.isHardwareCrcSupported,
calculateInSoftware : swCrc32c,

@@ -89,3 +89,3 @@ calculateOnHardware : hwCrc32c,

CRC32 : Crc32C,
calculate: calculate
calculate: Sse4Crc32.isHardwareCrcSupported() ? hwCrc32c : swCrc32c
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc