diff --git a/pages/tools/converter/base64-string-converter.vue b/pages/tools/converter/base64-string-converter.vue new file mode 100644 index 00000000..94c3b1e2 --- /dev/null +++ b/pages/tools/converter/base64-string-converter.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/utils/convert.ts b/utils/convert.ts new file mode 100644 index 00000000..abe9f983 --- /dev/null +++ b/utils/convert.ts @@ -0,0 +1,7 @@ +const base64ToString = (str: string) => Buffer.from(str, 'base64').toString('utf-8') +const stringToBase64 = (str: string) => Buffer.from(str, 'utf-8').toString('base64') + +export { + stringToBase64, + base64ToString +}