Socket
Socket
Sign inDemoInstall

@webassemblyjs/helper-numbers

Package Overview
Dependencies
3
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @webassemblyjs/helper-numbers

Number parsing utility


Version published
Weekly downloads
17M
increased by0.69%
Maintainers
1
Install size
213 kB
Created
Weekly downloads
 

Package description

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

Last updated on 13 Mar 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc