![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@digitalcredentials/base58-universal
Advanced tools
Encode/decode using the Base58 Bitcoin Encoding Scheme.
Encoder/decoder for The Base58 Encoding Scheme for Node.js and Web browsers
TBD
(Forked from digitalbazaar/base58-universal
to provide TypeScript compatibility.)
This library provides an encoder and decoder for The Base58 Encoding Scheme using an alphabet popularized by Bitcoin. It works in both Node.js and in Web browsers with no dependencies.
To install for Node.js or in a Web project using npm:
npm install @digitalcredentials/base58-universal
To install locally or for development:
git clone https://github.com/digitalcredentials/base58-universal.git
cd base58-universal
npm install
The library can be loaded with CommonJS or ESM:
const {encode, decode} = require('@digitalcredentials/base58-universal');
import {encode, decode} from '@digitalcredentials/base58-universal';
encode(input[, maxline])
input
: Uint8Array
- bytes to encodemaxline
: Number
- maximum number of encoded characters per line to
use, defaults to infinite.import {encode} from 'base58-universal';
const input1 = Uint8Array([1, 2, 3, 4]);
const encoded1 = encode(input1);
// > 2VfUX
const input2 = Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
const encoded2 = encode(input2, 8);
// > 4HUtbHhN\r\n2TkpR
decode(input)
input
: String
- string to decodeUint8Array
with the decoded bytes.import {decode} from 'base58-universal';
const input3 = '2VfUX';
const decoded3 = decode(input3);
// > Uint8Array [ 1, 2, 3, 4 ]
const input4 = '4HUtbHhN\r\n2TkpR';
const decoded4 = decode(input4);
// > Uint8Array [
// 1, 2, 3, 4, 5,
// 6, 7, 8, 9, 10
// ]
This library uses Uint8Array for encoder input and decoder output. Conversion to and from strings can be done with a variety of tools.
const input5 = new TextEncoder().encode('abc');
const encoded5 = encode(input5);
// > ZiCa
const decoded6 = decode(encoded5);
const output6 = new TextDecoder().decode(decoded6);
// > abc
from
and toString
with encoding options.// Using TextEncoder/TextDecoder
const {TextEncoder, TextDecoder} = require('util');
const input7 = new TextEncoder().encode('abc');
const encoded7 = encode(input7);
// > ZiCa
const decoded8 = decode(encoded7);
const output8 = new TextDecoder().decode(decoded8);
// > abc
// Using Buffer (which is a Uint8Array)
const input9 = Buffer.from('616263', 'hex');
const encoded9 = encode(input9);
const decoded9 = decode(encoded9);
Buffer.from(decoded9).toString();
// > abc
Buffer.from(decoded9).toString('hex');
// > 616263
Please follow the Bedrock contributing guidelines.
PRs accepted.
If editing the README, please conform to the standard-readme specification.
Commercial support for this library is available upon request from Digital Bazaar: support@digitalbazaar.com
New BSD License (3-clause) © Digital Bazaar
Encoder/decoder original implementation from base-x under the MIT License.
1.0.1 - 2021-09-17
@digitalcredentials/base58-universal
, remove esm
transpiler usage for TypeScript compatibility.FAQs
Encode/decode using the Base58 Bitcoin Encoding Scheme.
We found that @digitalcredentials/base58-universal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.