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

bigi

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bigi

Big integers.

  • 1.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is bigi?

The 'bigi' npm package is a JavaScript library for handling big integers. It provides functionalities for arithmetic operations, comparisons, and conversions of large integers, which are essential in cryptographic applications and other domains requiring precise large number calculations.

What are bigi's main functionalities?

Big Integer Creation

This feature allows you to create big integer instances from various formats such as hexadecimal strings. The code sample demonstrates creating a big integer from a hexadecimal string.

const bigi = require('bigi');
const bigInt = bigi.fromHex('1a2b3c');

Arithmetic Operations

Bigi supports arithmetic operations like addition, subtraction, multiplication, and division on big integers. The code sample shows how to add two big integers.

const bigi = require('bigi');
const a = bigi.fromHex('1a2b3c');
const b = bigi.fromHex('2b3c4d');
const sum = a.add(b);

Comparison Operations

This feature provides methods to compare big integers, such as checking for equality or determining which is greater. The code sample demonstrates checking if two big integers are equal.

const bigi = require('bigi');
const a = bigi.fromHex('1a2b3c');
const b = bigi.fromHex('2b3c4d');
const isEqual = a.equals(b);

Conversion to String

Bigi allows conversion of big integers to string representations in various formats, such as hexadecimal. The code sample shows converting a big integer back to a hexadecimal string.

const bigi = require('bigi');
const bigInt = bigi.fromHex('1a2b3c');
const hexString = bigInt.toHex();

Other packages similar to bigi

Keywords

FAQs

Package last updated on 27 Jul 2016

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