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

@webassemblyjs/helper-numbers

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webassemblyjs/helper-numbers

Number parsing utility

  • 1.14.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18M
decreased by-11.06%
Maintainers
1
Weekly downloads
 
Created

What is @webassemblyjs/helper-numbers?

The @webassemblyjs/helper-numbers package provides utilities for handling numbers in WebAssembly modules. It includes functions for parsing and formatting numbers according to the WebAssembly specification. This can be particularly useful when working with WebAssembly binary files or generating WebAssembly code programmatically.

What are @webassemblyjs/helper-numbers's main functionalities?

Parsing floating point numbers

This feature allows for the parsing of floating point numbers from their string representation into their binary format as used in WebAssembly. The code sample demonstrates parsing 32-bit and 64-bit floating point numbers.

"use strict";\nconst { parseF32, parseF64 } = require('@webassemblyjs/helper-numbers');\nconsole.log(parseF32('0x1.fffffep+127'));\nconsole.log(parseF64('0x1.fffffffffffffp+1023'));

Formatting floating point numbers

This feature enables the formatting of floating point numbers from their binary representation in WebAssembly to a human-readable string format. The code sample shows how to format 32-bit and 64-bit floating point numbers.

"use strict";\nconst { formatF32, formatF64 } = require('@webassemblyjs/helper-numbers');\nconsole.log(formatF32(1.5));\nconsole.log(formatF64(-1.5));

Parsing integer numbers

This functionality allows for the parsing of integer numbers from their string representation into their binary format as used in WebAssembly. The code sample demonstrates parsing 32-bit and 64-bit integer numbers.

"use strict";\nconst { parseI32, parseI64 } = require('@webassemblyjs/helper-numbers');\nconsole.log(parseI32('0xff'));\nconsole.log(parseI64('0xff'));

Other packages similar to @webassemblyjs/helper-numbers

FAQs

Package last updated on 06 Nov 2024

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