6 lines
174 B
TypeScript
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}`;
|
|
};
|