Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | 4x 4x 4x 4x 500x 500x 268x | import {hasBuffer} from './constants';
import {createToBase64} from './createToBase64';
const encodeSmall = createToBase64();
export const toBase64 = !hasBuffer
? (uint8: Uint8Array) => encodeSmall(uint8, uint8.length)
: (uint8: Uint8Array): string => {
const length = uint8.length;
if (length <= 48) return encodeSmall(uint8, length);
return Buffer.from(uint8).toString('base64');
};
|