New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

any-base

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any-base

Converter from any base to other any base

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6M
increased by7.15%
Maintainers
1
Weekly downloads
 
Created

What is any-base?

The any-base npm package allows you to convert numbers between different bases. It supports conversions between any two bases ranging from binary (base 2) to base 62.

What are any-base's main functionalities?

Convert from one base to another

This feature allows you to convert a number from one base to another. In this example, a binary number ('1010') is converted to a hexadecimal number ('A').

const anyBase = require('any-base');
const base2ToBase16 = anyBase(anyBase.BIN, anyBase.HEX);
console.log(base2ToBase16('1010')); // Outputs 'A'

Custom base conversion

This feature allows you to define custom bases for conversion. In this example, a decimal number ('255') is converted to a hexadecimal number ('ff') using custom base definitions.

const anyBase = require('any-base');
const customBase = anyBase('0123456789', '0123456789abcdef');
console.log(customBase('255')); // Outputs 'ff'

Other packages similar to any-base

Keywords

FAQs

Package last updated on 09 Oct 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