mirror of https://github.com/qntm/base65536
Compare commits
2 Commits
6a37345d04
...
0d4094d746
Author | SHA1 | Date |
---|---|---|
qntm | 0d4094d746 | |
Bryan C | f1c3ae056e |
|
@ -1,2 +1,3 @@
|
||||||
*
|
*
|
||||||
!dist/**/*
|
!dist/**/*
|
||||||
|
!typings/**/*
|
||||||
|
|
|
@ -1926,7 +1926,8 @@
|
||||||
"base65536-test": {
|
"base65536-test": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/base65536-test/-/base65536-test-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/base65536-test/-/base65536-test-1.1.2.tgz",
|
||||||
"integrity": "sha1-C+VeHrOXMYXTipCVGFvEAtQqMrM="
|
"integrity": "sha1-C+VeHrOXMYXTipCVGFvEAtQqMrM=",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"bcrypt-pbkdf": {
|
"bcrypt-pbkdf": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "base65536",
|
"name": "base65536",
|
||||||
"version": "3.0.0",
|
"version": "3.0.1",
|
||||||
"description": "Unicode's answer to Base64",
|
"description": "Unicode's answer to Base64",
|
||||||
"module": "dist/es6/base65536.js",
|
"module": "dist/es6/base65536.js",
|
||||||
"main": "dist/cjs/base65536.js",
|
"main": "dist/cjs/base65536.js",
|
||||||
|
"types": "typings/index.d.ts",
|
||||||
"browser": "dist/iife/base65536.js",
|
"browser": "dist/iife/base65536.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"jest": "jest",
|
"jest": "jest",
|
||||||
|
|
|
@ -42,7 +42,7 @@ pairStrings.forEach((pairString, r) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
export const encode = uint8Array => {
|
const encode = uint8Array => {
|
||||||
const length = uint8Array.length
|
const length = uint8Array.length
|
||||||
|
|
||||||
let str = ''
|
let str = ''
|
||||||
|
@ -80,7 +80,7 @@ export const encode = uint8Array => {
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|
||||||
export const decode = str => {
|
const decode = str => {
|
||||||
const length = str.length
|
const length = str.length
|
||||||
|
|
||||||
// This length is a guess. There's a chance we allocate one more byte here
|
// This length is a guess. There's a chance we allocate one more byte here
|
||||||
|
@ -131,3 +131,5 @@ export const decode = str => {
|
||||||
|
|
||||||
return new Uint8Array(uint8Array.buffer, 0, numUint8s)
|
return new Uint8Array(uint8Array.buffer, 0, numUint8s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export { encode, decode }
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
export declare const encode: (uint8Array: Uint8Array) => string;
|
||||||
|
export declare const decode: (str: string) => Uint8Array;
|
Loading…
Reference in New Issue