@smithy/util-base64
Advanced tools
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.maxLetterValue = exports.bitsPerByte = exports.bitsPerLetter = exports.alphabetByValue = exports.alphabetByEncoding = void 0; | ||
| const alphabetByEncoding = {}; | ||
| exports.alphabetByEncoding = alphabetByEncoding; | ||
| const alphabetByValue = new Array(64); | ||
| exports.alphabetByValue = alphabetByValue; | ||
| for (let i = 0, start = "A".charCodeAt(0), limit = "Z".charCodeAt(0); i + start <= limit; i++) { | ||
| const char = String.fromCharCode(i + start); | ||
| alphabetByEncoding[char] = i; | ||
| alphabetByValue[i] = char; | ||
| } | ||
| for (let i = 0, start = "a".charCodeAt(0), limit = "z".charCodeAt(0); i + start <= limit; i++) { | ||
| const char = String.fromCharCode(i + start); | ||
| const index = i + 26; | ||
| alphabetByEncoding[char] = index; | ||
| alphabetByValue[index] = char; | ||
| } | ||
| for (let i = 0; i < 10; i++) { | ||
| alphabetByEncoding[i.toString(10)] = i + 52; | ||
| const char = i.toString(10); | ||
| const index = i + 52; | ||
| alphabetByEncoding[char] = index; | ||
| alphabetByValue[index] = char; | ||
| } | ||
| alphabetByEncoding["+"] = 62; | ||
| alphabetByValue[62] = "+"; | ||
| alphabetByEncoding["/"] = 63; | ||
| alphabetByValue[63] = "/"; | ||
| const bitsPerLetter = 6; | ||
| exports.bitsPerLetter = bitsPerLetter; | ||
| const bitsPerByte = 8; | ||
| exports.bitsPerByte = bitsPerByte; | ||
| const maxLetterValue = 0b111111; | ||
| exports.maxLetterValue = maxLetterValue; | ||
| const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`; | ||
| exports.alphabetByEncoding = Object.entries(chars).reduce((acc, [i, c]) => { | ||
| acc[c] = Number(i); | ||
| return acc; | ||
| }, {}); | ||
| exports.alphabetByValue = chars.split(""); | ||
| exports.bitsPerLetter = 6; | ||
| exports.bitsPerByte = 8; | ||
| exports.maxLetterValue = 0b111111; |
@@ -1,28 +0,9 @@ | ||
| const alphabetByEncoding = {}; | ||
| const alphabetByValue = new Array(64); | ||
| for (let i = 0, start = "A".charCodeAt(0), limit = "Z".charCodeAt(0); i + start <= limit; i++) { | ||
| const char = String.fromCharCode(i + start); | ||
| alphabetByEncoding[char] = i; | ||
| alphabetByValue[i] = char; | ||
| } | ||
| for (let i = 0, start = "a".charCodeAt(0), limit = "z".charCodeAt(0); i + start <= limit; i++) { | ||
| const char = String.fromCharCode(i + start); | ||
| const index = i + 26; | ||
| alphabetByEncoding[char] = index; | ||
| alphabetByValue[index] = char; | ||
| } | ||
| for (let i = 0; i < 10; i++) { | ||
| alphabetByEncoding[i.toString(10)] = i + 52; | ||
| const char = i.toString(10); | ||
| const index = i + 52; | ||
| alphabetByEncoding[char] = index; | ||
| alphabetByValue[index] = char; | ||
| } | ||
| alphabetByEncoding["+"] = 62; | ||
| alphabetByValue[62] = "+"; | ||
| alphabetByEncoding["/"] = 63; | ||
| alphabetByValue[63] = "/"; | ||
| const bitsPerLetter = 6; | ||
| const bitsPerByte = 8; | ||
| const maxLetterValue = 0b111111; | ||
| export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue }; | ||
| const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`; | ||
| export const alphabetByEncoding = Object.entries(chars).reduce((acc, [i, c]) => { | ||
| acc[c] = Number(i); | ||
| return acc; | ||
| }, {}); | ||
| export const alphabetByValue = chars.split(""); | ||
| export const bitsPerLetter = 6; | ||
| export const bitsPerByte = 8; | ||
| export const maxLetterValue = 0b111111; |
@@ -1,6 +0,5 @@ | ||
| declare const alphabetByEncoding: Record<string, number>; | ||
| declare const alphabetByValue: Array<string>; | ||
| declare const bitsPerLetter = 6; | ||
| declare const bitsPerByte = 8; | ||
| declare const maxLetterValue = 63; | ||
| export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue }; | ||
| export declare const alphabetByEncoding: Record<string, number>; | ||
| export declare const alphabetByValue: Array<string>; | ||
| export declare const bitsPerLetter = 6; | ||
| export declare const bitsPerByte = 8; | ||
| export declare const maxLetterValue = 63; |
@@ -1,6 +0,5 @@ | ||
| declare const alphabetByEncoding: Record<string, number>; | ||
| declare const alphabetByValue: Array<string>; | ||
| declare const bitsPerLetter = 6; | ||
| declare const bitsPerByte = 8; | ||
| declare const maxLetterValue = 63; | ||
| export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue }; | ||
| export declare const alphabetByEncoding: Record<string, number>; | ||
| export declare const alphabetByValue: Array<string>; | ||
| export declare const bitsPerLetter = 6; | ||
| export declare const bitsPerByte = 8; | ||
| export declare const maxLetterValue = 63; |
+1
-1
| { | ||
| "name": "@smithy/util-base64", | ||
| "version": "4.2.0", | ||
| "version": "4.3.0", | ||
| "description": "A Base64 <-> UInt8Array converter", | ||
@@ -5,0 +5,0 @@ "main": "./dist-cjs/index.js", |
27023
-5.57%327
-11.86%