Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@thi.ng/base-n
Advanced tools
Arbitrary base-n conversions w/ presets for base16/32/36/58/62/64/85, support for arrays & bigints
This project is part of the @thi.ng/umbrella monorepo.
Arbitrary base-n encoding/decoding with presets for base32/36/58/62/64/85 and support for bigints.
BETA - possibly breaking changes forthcoming
Search or submit any issues for this package
yarn add @thi.ng/base-n
// ES module
<script type="module" src="https://unpkg.com/@thi.ng/base-n?module" crossorigin></script>
// UMD
<script src="https://unpkg.com/@thi.ng/base-n/lib/index.umd.js" crossorigin></script>
Package sizes (gzipped, pre-treeshake): ESM: 626 bytes / CJS: 715 bytes / UMD: 800 bytes
None
import { BASE85, defBase } from "@thi.ng/base-n";
BASE85.encodeBigInt(2n ** 128n - 1);
// '=r54lj&NUUO~Hi%c2ym0'
BASE85.decodeBigInt("=r54lj&NUUO~Hi%c2ym0").toString(16);
// 'ffffffffffffffffffffffffffffffff'
// define a custom base impl
const ternary = defBase("012");
ternary.encode(12345678)
// '212020020002100'
ternary.decode("212020020002100");
// 12345678
Karsten Schmidt
If this project contributes to an academic publication, please cite it as:
@misc{thing-base-n,
title = "@thi.ng/base-n",
author = "Karsten Schmidt",
note = "https://thi.ng/base-n",
year = 2017
}
© 2017 - 2021 Karsten Schmidt // Apache Software License 2.0
FAQs
Arbitrary base-n conversions w/ presets for base8/16/32/36/58/62/64/83/85, support for bigints and encoding/decoding of byte arrays
The npm package @thi.ng/base-n receives a total of 323 weekly downloads. As such, @thi.ng/base-n popularity was classified as not popular.
We found that @thi.ng/base-n demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.