🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@node-rs/crc32

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-rs/crc32 - npm Package Compare versions

Comparing version
1.4.3
to
1.5.0
+43
-17
index.js

@@ -8,20 +8,48 @@ const { existsSync, readFileSync } = require('fs')

let localFileExisted = false
let isMusl = false
let loadError = null
function isMusl() {
// For Node 10
if (!process.report || typeof process.report.getReport !== 'function') {
try {
return readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
} catch (e) {
return true
}
} else {
const { glibcVersionRuntime } = process.report.getReport().header
return !glibcVersionRuntime
}
}
switch (platform) {
case 'android':
if (arch !== 'arm64') {
throw new Error(`Unsupported architecture on Android ${arch}`)
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'crc32.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./crc32.android-arm64.node')
} else {
nativeBinding = require('@node-rs/crc32-android-arm64')
}
} catch (e) {
loadError = e
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'crc32.android-arm-eabi.node'))
try {
if (localFileExisted) {
nativeBinding = require('./crc32.android-arm-eabi.node')
} else {
nativeBinding = require('@node-rs/crc32-android-arm-eabi')
}
} catch (e) {
loadError = e
}
break
default:
throw new Error(`Unsupported architecture on Android ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'crc32.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./crc32.android-arm64.node')
} else {
nativeBinding = require('@node-rs/crc32-android-arm64')
}
} catch (e) {
loadError = e
}
break

@@ -118,4 +146,3 @@ case 'win32':

case 'x64':
isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
if (isMusl) {
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, 'crc32.linux-x64-musl.node'))

@@ -145,4 +172,3 @@ try {

case 'arm64':
isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
if (isMusl) {
if (isMusl()) {
localFileExisted = existsSync(join(__dirname, 'crc32.linux-arm64-musl.node'))

@@ -149,0 +175,0 @@ try {

{
"name": "@node-rs/crc32",
"version": "1.4.3",
"version": "1.5.0",
"description": "SIMD crc32",

@@ -55,4 +55,4 @@ "keywords": [

"bench": "cross-env NODE_ENV=production node benchmark/crc32.js",
"build": "napi build --platform --release --pipe \"prettier -w\" --js false",
"build:debug": "napi build --platform --pipe \"prettier -w\" --js false",
"build": "napi build --platform --release --pipe \"prettier -w\"",
"build:debug": "napi build --platform --pipe \"prettier -w\"",
"prepublishOnly": "napi prepublish",

@@ -74,18 +74,18 @@ "version": "napi version"

},
"gitHead": "3e555f1bc2597d7e6a2f78b4b937f2b22a7aa79b",
"gitHead": "3d329ba0ec01daabe4b9f6b1f2757d19d30be1c8",
"optionalDependencies": {
"@node-rs/crc32-win32-x64-msvc": "1.4.3",
"@node-rs/crc32-darwin-x64": "1.4.3",
"@node-rs/crc32-linux-x64-gnu": "1.4.3",
"@node-rs/crc32-win32-ia32-msvc": "1.4.3",
"@node-rs/crc32-linux-arm-gnueabihf": "1.4.3",
"@node-rs/crc32-linux-x64-musl": "1.4.3",
"@node-rs/crc32-linux-arm64-gnu": "1.4.3",
"@node-rs/crc32-darwin-arm64": "1.4.3",
"@node-rs/crc32-android-arm64": "1.4.3",
"@node-rs/crc32-android-arm-eabi": "1.4.3",
"@node-rs/crc32-freebsd-x64": "1.4.3",
"@node-rs/crc32-linux-arm64-musl": "1.4.3",
"@node-rs/crc32-win32-arm64-msvc": "1.4.3"
"@node-rs/crc32-win32-x64-msvc": "1.5.0",
"@node-rs/crc32-darwin-x64": "1.5.0",
"@node-rs/crc32-linux-x64-gnu": "1.5.0",
"@node-rs/crc32-win32-ia32-msvc": "1.5.0",
"@node-rs/crc32-linux-arm-gnueabihf": "1.5.0",
"@node-rs/crc32-linux-x64-musl": "1.5.0",
"@node-rs/crc32-linux-arm64-gnu": "1.5.0",
"@node-rs/crc32-darwin-arm64": "1.5.0",
"@node-rs/crc32-android-arm64": "1.5.0",
"@node-rs/crc32-android-arm-eabi": "1.5.0",
"@node-rs/crc32-freebsd-x64": "1.5.0",
"@node-rs/crc32-linux-arm64-musl": "1.5.0",
"@node-rs/crc32-win32-arm64-msvc": "1.5.0"
}
}