Files
FastGPT/projects/sandbox/src/sandbox/jsFn/str2Base64.ts
Archer e0a79bef51 feat: sandbox support str to base64 function;feat: compiance text ui (#2702)
* feat: sandbox strToBase64 function

* feat: compiance text ui
2024-10-12 15:22:59 +08:00

6 lines
174 B
TypeScript

export const strToBase64 = (str: string, prefix: string) => {
const base64_string = Buffer.from(str, 'utf-8').toString('base64');
return `${prefix}${base64_string}`;
};