mirror of
https://github.com/cocos/cocos-engine.git
synced 2026-09-07 00:02:53 +08:00
15 lines
381 B
TypeScript
15 lines
381 B
TypeScript
|
|
const BASE64_KEYS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
|
|
const BASE64_VALUES = new Array<number>(123); // max char code in base64Keys
|
|
|
|
for (let i = 0; i < 123; ++i) {
|
|
BASE64_VALUES[i] = 64; // fill with placeholder('=') index
|
|
}
|
|
|
|
for (let i = 0; i < 64; ++i) {
|
|
BASE64_VALUES[BASE64_KEYS.charCodeAt(i)] = i;
|
|
}
|
|
|
|
export default BASE64_VALUES;
|