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

biggystring

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biggystring

Wrapper for bn.js to directly operate on strings as big numbers

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

biggystring

Big number library using only strings as inputs and outputs

Install

npm install biggystring

Use

const bs = require('biggystring')

Basic Math

console.log(bs.add('32', '10') // => '42'
console.log(bs.sub('32', '10') // => '22'
console.log(bs.mul('32', '10') // => '320'
console.log(bs.div('32', '10') // => '3' Truncates remainder

Hex

console.log(bs.add('0xa', '10')   // => '20'
console.log(bs.add('0xa', '0x20') // => '42'
console.log(bs.add('10', '0x10')  // => '26'

Comparisons

console.log(bs.gt('32', '10')  // => 'True'
console.log(bs.lt('32', '10')  // => 'False'
console.log(bs.gte('32', '32') // => 'True'
console.log(bs.lte('32', '10') // => 'False'
console.log(bs.eq('32', '10')  // => 'False'
console.log(bs.eq('32', '32')  // => 'True'

Keywords

FAQs

Package last updated on 02 Aug 2017

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