MCPcopy Index your code
hub / github.com/anomalyco/opencode / base64Encode

Function base64Encode

packages/core/src/util/encode.ts:1–5  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

1export function base64Encode(value: string) {
2 const bytes = new TextEncoder().encode(value)
3 const binary = Array.from(bytes, (b) => String.fromCharCode(b)).join("")
4 return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "")
5}
6
7export function base64Decode(value: string) {
8 const binary = atob(value.replace(/-/g, "+").replace(/_/g, "/"))

Callers 15

handleSelectFunction · 0.90
handleSelectFunction · 0.90
SessionTabSlotFunction · 0.90
handleSubmitFunction · 0.90
sessionHrefFunction · 0.90
legacySessionHrefFunction · 0.90
requireServerKeyFunction · 0.90
DirectoryDataProviderFunction · 0.90
openProjectFunction · 0.90
PageFunction · 0.90
useSDKNotificationToastsFunction · 0.90
openSessionFunction · 0.90

Calls 1

fromMethod · 0.45

Tested by 5

openReviewFunction · 0.72
configurePageFunction · 0.72
sessionHrefFunction · 0.72
navigateToSessionFunction · 0.72
switchTitlebarSessionFunction · 0.72