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

@webassemblyjs/ieee754

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webassemblyjs/ieee754

IEEE754 decoder and encoder

  • 1.6.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17M
decreased by-27.54%
Maintainers
1
Weekly downloads
 
Created

What is @webassemblyjs/ieee754?

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.

What are @webassemblyjs/ieee754's main functionalities?

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);

Other packages similar to @webassemblyjs/ieee754

FAQs

Package last updated on 16 Jul 2018

Did you know?

Socket

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.

Install

Related posts

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