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

bigint-conversion

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bigint-conversion

Convert to/from BigInt from/to Buffer, ArrayBuffer, hex string, utf8-encoded text string.

  • 2.4.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Licence: MIT Contributor Covenant JavaScript Style Guide Node.js CI Coverage Status

bigint-conversion

Convert to/from non-negative integers represented with ES-2020 native JS implementation of BigInt from/to:

  • Buffer (node.js) or ArrayBuffer|TypedArray (native js),
  • hex string,
  • utf8-encoded text string,
  • standard and url-safe base64 with and without padding.

It provides a common interface for the conversions that works for both node.js and native javascript.

Note that there is not a directly visible TypedArray() constructor, but a set of typed array ones: Int8Array(), Uint8Array(), Uint8ClampedArray(), Int16Array(), Uint16Array(), Int32Array(), Uint32Array(), Float32Array(), Float64Array(), BigInt64Array(), BigUint64Array().

Usage

bigint-conversion can be imported to your project with npm:

npm install bigint-conversion

Then either require (Node.js CJS):

const bigintConversion = require('bigint-conversion')

or import (JavaScript ES module):

import * as bigintConversion from 'bigint-conversion'

The appropriate version for browser or node is automatically exported.

BigInt is ES-2020. In order to use it with TypeScript you should set target (and probably also lib) to at least es2020 in tsconfig.json.

You can also download the IIFE bundle, the ESM bundle or the UMD bundle and manually add it to your project, or, if you have already installed bigint-conversion in your project, just get the bundles from node_modules/bigint-conversion/dist/bundles/.

API reference documentation

Check the API

Keywords

FAQs

Package last updated on 10 Nov 2023

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