Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simdle-universal

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simdle-universal - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

26

fallback.js

@@ -70,2 +70,28 @@ const b4a = require('b4a')

exports.allo = function allo (buf) {
if (buf.byteLength % 16 !== 0) {
throw new Error('Buffer length must be a multiple of 16')
}
const m = 2 ** (buf.BYTES_PER_ELEMENT * 8) - 1
for (let i = 0, n = buf.length; i < n; i++) {
if (buf[i] !== m) return false
}
return true
}
exports.allz = function allz (buf) {
if (buf.byteLength % 16 !== 0) {
throw new Error('Buffer length must be a multiple of 16')
}
for (let i = 0, n = buf.length; i < n; i++) {
if (buf[i] !== 0) return false
}
return true
}
exports.and = binary(

@@ -72,0 +98,0 @@ (a, b, result) => {

@@ -58,2 +58,18 @@ const binding = require('node-gyp-build')(__dirname)

exports.allo = function allo (buf) {
if (buf.byteLength % 16 !== 0) {
throw new Error('Buffer length must be a multiple of 16')
}
return binding.simdle_napi_allo_v128(buf) !== 0
}
exports.allz = function allz (buf) {
if (buf.byteLength % 16 !== 0) {
throw new Error('Buffer length must be a multiple of 16')
}
return binding.simdle_napi_allz_v128(buf) !== 0
}
exports.and = binary(

@@ -60,0 +76,0 @@ binding.simdle_napi_and_v128_u8,

2

package.json
{
"name": "simdle-universal",
"version": "1.0.4",
"version": "1.1.0",
"description": "Universal wrapper for libsimdle with a JavaScript fallback",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -22,2 +22,10 @@ # simdle-universal

#### `const result = allo(buffer)`
Check if the buffer contains only ones.
#### `const result = allz(buffer)`
Check if the buffer contains only zeros.
#### `const result = and(a, b[, result])`

@@ -24,0 +32,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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