Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@webassemblyjs/ieee754
Advanced tools
The @webassemblyjs/ieee754 package is designed for encoding and decoding floating-point numbers according to the IEEE 754 standard. This is particularly useful when working with WebAssembly, as it allows for precise handling of floating-point numbers in a format that's compatible with WebAssembly's binary representation.
Encoding floating-point numbers
This feature allows you to encode JavaScript floating-point numbers into a format that's compatible with WebAssembly's binary representation. The example shows how to encode the number 1.5 as a 64-bit floating-point number.
const { encode } = require('@webassemblyjs/ieee754');
const buffer = new ArrayBuffer(8);
const view = new DataView(buffer);
encode(view, 0, 1.5, 64);
Decoding floating-point numbers
This feature allows you to decode floating-point numbers from a binary format into JavaScript numbers. The example demonstrates decoding a 64-bit floating-point number from a DataView into a JavaScript number.
const { decode } = require('@webassemblyjs/ieee754');
const buffer = new ArrayBuffer(8);
const view = new DataView(buffer);
view.setFloat64(0, 1.5, true);
const number = decode(view, 0, 64);
The ieee754 package provides similar functionality for encoding and decoding IEEE 754 floating-point numbers. It is widely used for operations that require direct manipulation of binary data in this format. Compared to @webassemblyjs/ieee754, it serves a broader audience beyond just the WebAssembly community, offering a more general-purpose approach to handling IEEE 754 floating-point numbers.
FAQs
IEEE754 decoder and encoder
The npm package @webassemblyjs/ieee754 receives a total of 19,066,651 weekly downloads. As such, @webassemblyjs/ieee754 popularity was classified as popular.
We found that @webassemblyjs/ieee754 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.