New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

mixed-radix

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixed-radix

Mixed Radix

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
410
58.91%
Maintainers
1
Weekly downloads
 
Created
Source

Mixed Radix

Travis npm Coverage Status

A small library that encode and decode using mixed radix.

Try it online.

Install

npm install --save mixed-radix

Usage

mrDecode([2, 3], 5); // [1, 2]
mrEncode([2, 3], [1, 2]); // 5

mrDecode([3, 3, 2], 7); // [1, 0, 1]
mrEncode([3, 3, 2], [1, 0, 1]); // 7

mrDecode([24, 24, 60], 3661); // [1, 1, 1]
mrEncode([24, 60, 60], [1, 1, 1])); // 3661

API

mrEncode(bases, ns)

Encodes using mixed radix.

  • bases: number[] Mixed bases, must be integers.
  • ns: number[] Values to encode, must be an array of integer with the same length as bases.

return: number Encoded values.

mrDecode(bases, n)

Decodes mixed radix.

  • bases: number[] Mixed bases, must be an array integers.
  • n: number[] Values to decode, must be an integer.

return: number[] Decoded values.

License

MIT

FAQs

Package last updated on 11 Mar 2018

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