@abdellatif.dev/cryptjs
Version:
A JavaScript/TypeScript library that brings cryptographic functionality from Dart to the web
24 lines (23 loc) • 559 B
JavaScript
;
import StringBuffer from "./StringBuffer";
export const base64EncodingChars = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
export function encode3Bytes(result, c, b, a) {
let n;
let w;
if (a != null && b != null) {
n = 4;
w = c << 16 | b << 8 | a;
} else if (b != null) {
n = 3;
w = c << 8 | b;
} else {
n = 2;
w = c;
}
while (0 < n--) {
let value = w & 63;
result.append(base64EncodingChars.substring(value, value + 1));
w >>= 6;
}
}
//# sourceMappingURL=encode.js.map