MCPcopy Create free account
hub / github.com/SIMARSINGHRAYAT/Gitzo / utf8ToBase64

Function utf8ToBase64

src/utils/github.ts:152–159  ·  view source on GitHub ↗

* Encode a UTF-8 string to base64 safely (supports non-ASCII characters).

(str: string)

Source from the content-addressed store, hash-verified

150 * Encode a UTF-8 string to base64 safely (supports non-ASCII characters).
151 */
152function utf8ToBase64(str: string): string {
153 const bytes = new TextEncoder().encode(str);
154 let binary = '';
155 for (let i = 0; i < bytes.length; i++) {
156 binary += String.fromCharCode(bytes[i]);
157 }
158 return btoa(binary);
159}
160
161/** Standard error handler for git operations */
162async function handleGitError(res: Response, step: string) {

Callers 2

createFileOnBranchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected