Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@little-core-labs/varint-wasm
Advanced tools
A varint implementation for WebAssembly (WASM) written in ZZ that implements an Abstract Encoding interface.
$ npm install @little-core-labs/varint-wasm
$ wapm install jwerle/varint-wasm
const varint = require('varint-wasm')
// wait for module to be ready if loading in a browser environment
varint.ready(() => {
const encoded = varint.encode(64 * 1024)
console.log(encoded) // <Buffer 80 80 04>
const decoded = varint.decode(encoded)
console.log(decoded) // 65536
})
buffer = encode(number[, buffer[, offset]])
Encode a number
optionally into buffer
at an optionally
specified offset
.
number = decode(buffer[, offset])
Decode an input buffer into an integer optionally an optionally
specified offset
.
promise = ready(callback)
Returns a promise that resolves or rejects when the WebAssembly exports are loading. In some cases, this may happen synchronously when this module is loaded.
await b64.ready()
Because 32-bit integers are only supported in WASM at the time of
writing, you can only encode numbers up 2**31 -1
.
By default, this module allocates 2 pages of memory for the WebAssembly module.
That is 2 * 64 * 1024
bytes.
This module allows at most 256 pages of memory. That is 256 * 64 * 1024
bytes.
MIT
FAQs
A varint implementation compiled to WASM format
We found that @little-core-labs/varint-wasm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.