shortcuts/plot/src/utils.go

17 lines
256 B
Go
Raw Normal View History

2024-09-29 18:27:50 +00:00
//go:build js && wasm
// +build js,wasm
package src
import (
"bytes"
"encoding/base64"
"io"
)
func WriterToBase64String(writer io.WriterTo) string {
var buf bytes.Buffer
writer.WriteTo(&buf)
return base64.StdEncoding.EncodeToString(buf.Bytes())
}