useBase64
Reactive base64 transforming. Supports plain text, buffer, files, canvas, objects, maps, sets and images.
Demo
Text Input
Base64
Buffer Input
new ArrayBuffer(1024)
Base64
File Input
Base64
Image Input
Base64
Usage
ts
import { useBase64 } from 'comuse-core'
import { shallowRef } from 'vue'
const text = shallowRef('')
const { base64 } = useBase64(text)If you use object, array, map or set you can provide serializer in options. Otherwise, your data will be serialized by default serializer. Objects and arrays will be transformed in string by JSON.stringify. Map and set will be transformed in object and array respectively before stringify.