MCPcopy Create free account
hub / github.com/bytebase/bytebase / base64ToArrayBuffer

Function base64ToArrayBuffer

frontend/src/utils/sqlResult.ts:36–43  ·  view source on GitHub ↗
(base64: string)

Source from the content-addressed store, hash-verified

34};
35
36const base64ToArrayBuffer = (base64: string): ArrayBuffer => {
37 const binaryString = atob(base64);
38 const bytes = new Uint8Array(binaryString.length);
39 for (let i = 0; i < binaryString.length; i++) {
40 bytes[i] = binaryString.charCodeAt(i);
41 }
42 return bytes.buffer;
43};
44
45const decodeBase64ToUUID = (base64Encoded: string): string => {
46 const uint8Array = new Uint8Array(base64ToArrayBuffer(base64Encoded));

Callers 1

decodeBase64ToUUIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected