MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / decodeBase64ToUnicode

Function decodeBase64ToUnicode

frontend/packages/common/src/utils/download.ts:1–9  ·  view source on GitHub ↗
(base64Str: string)

Source from the content-addressed store, hash-verified

1export const decodeBase64ToUnicode = (base64Str: string): string => {
2 // Decode base64 to a string using atob and convert it to a unicode string.
3 return decodeURIComponent(
4 atob(base64Str)
5 .split('')
6 ?.map((char) => `%${char.charCodeAt(0).toString(16).padStart(2, '0')}`)
7 .join('')
8 )
9}
10
11interface DownloadOptions {
12 body: string

Callers 1

downloadFileFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected