@scure/base
Advanced tools
Comparing version 1.1.6 to 1.1.7
14
index.ts
@@ -334,2 +334,7 @@ /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ | ||
); | ||
export const base32nopad: BytesCoder = /* @__PURE__ */ chain( | ||
radix2(5), | ||
alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), | ||
join('') | ||
); | ||
export const base32hex: BytesCoder = /* @__PURE__ */ chain( | ||
@@ -341,2 +346,7 @@ radix2(5), | ||
); | ||
export const base32hexnopad: BytesCoder = /* @__PURE__ */ chain( | ||
radix2(5), | ||
alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), | ||
join('') | ||
); | ||
export const base32crockford: BytesCoder = /* @__PURE__ */ chain( | ||
@@ -414,5 +424,3 @@ radix2(5), | ||
export const createBase58check = /* @__PURE__ */ ( | ||
sha256: (data: Uint8Array) => Uint8Array | ||
): BytesCoder => | ||
export const createBase58check = (sha256: (data: Uint8Array) => Uint8Array): BytesCoder => | ||
chain( | ||
@@ -419,0 +427,0 @@ checksum(4, (data) => sha256(sha256(data))), |
@@ -310,3 +310,5 @@ /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ | ||
export const base32 = /* @__PURE__ */ chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join('')); | ||
export const base32nopad = /* @__PURE__ */ chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join('')); | ||
export const base32hex = /* @__PURE__ */ chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join('')); | ||
export const base32hexnopad = /* @__PURE__ */ chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join('')); | ||
export const base32crockford = /* @__PURE__ */ chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1'))); | ||
@@ -351,3 +353,3 @@ export const base64 = /* @__PURE__ */ chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join('')); | ||
}; | ||
export const createBase58check = /* @__PURE__ */ (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), base58); | ||
export const createBase58check = (sha256) => chain(checksum(4, (data) => sha256(sha256(data))), base58); | ||
// legacy export, bad name | ||
@@ -354,0 +356,0 @@ export const base58check = createBase58check; |
@@ -79,3 +79,5 @@ /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ | ||
export declare const base32: BytesCoder; | ||
export declare const base32nopad: BytesCoder; | ||
export declare const base32hex: BytesCoder; | ||
export declare const base32hexnopad: BytesCoder; | ||
export declare const base32crockford: BytesCoder; | ||
@@ -82,0 +84,0 @@ export declare const base64: BytesCoder; |
"use strict"; | ||
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.createBase58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64urlnopad = exports.base64url = exports.base64nopad = exports.base64 = exports.base32crockford = exports.base32hex = exports.base32 = exports.base16 = exports.utils = exports.assertNumber = void 0; | ||
exports.bytes = exports.stringToBytes = exports.str = exports.bytesToString = exports.hex = exports.utf8 = exports.bech32m = exports.bech32 = exports.base58check = exports.createBase58check = exports.base58xmr = exports.base58xrp = exports.base58flickr = exports.base58 = exports.base64urlnopad = exports.base64url = exports.base64nopad = exports.base64 = exports.base32crockford = exports.base32hexnopad = exports.base32hex = exports.base32nopad = exports.base32 = exports.base16 = exports.utils = exports.assertNumber = void 0; | ||
// Utilities | ||
@@ -314,3 +314,5 @@ /** | ||
exports.base32 = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), padding(5), join('')); | ||
exports.base32nopad = chain(radix2(5), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'), join('')); | ||
exports.base32hex = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), padding(5), join('')); | ||
exports.base32hexnopad = chain(radix2(5), alphabet('0123456789ABCDEFGHIJKLMNOPQRSTUV'), join('')); | ||
exports.base32crockford = chain(radix2(5), alphabet('0123456789ABCDEFGHJKMNPQRSTVWXYZ'), join(''), normalize((s) => s.toUpperCase().replace(/O/g, '0').replace(/[IL]/g, '1'))); | ||
@@ -317,0 +319,0 @@ exports.base64 = chain(radix2(6), alphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'), padding(6), join('')); |
{ | ||
"name": "@scure/base", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "Secure, audited & 0-dep implementation of base64, bech32, base58, base32 & base16", | ||
"files": [ | ||
"lib/index.js", | ||
"lib/index.js.map", | ||
"lib/esm/index.js", | ||
"lib/esm/index.js.map", | ||
"lib/esm/package.json", | ||
@@ -9,0 +11,0 @@ "lib/index.d.ts", |
@@ -44,3 +44,5 @@ # scure-base | ||
base58xrp, | ||
base32nopad, | ||
base32hex, | ||
base32hexnopad, | ||
base32crockford, | ||
@@ -47,0 +49,0 @@ base64nopad, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121636
11
1643
213