MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / base64urlEncode

Function base64urlEncode

packages/kilo-chat/src/utils.ts:70–74  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

68export type ConversationCursor = z.infer<typeof conversationCursorSchema>;
69
70function base64urlEncode(bytes: Uint8Array): string {
71 let binary = '';
72 for (const byte of bytes) binary += String.fromCharCode(byte);
73 return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
74}
75
76function base64urlDecode(str: string): Uint8Array {
77 const padded = str.replace(/-/g, '+').replace(/_/g, '/');

Callers 1

encodeConversationCursorFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected