riffusion-inference/riffusion/util/base64_util.py

10 lines
185 B
Python
Raw Permalink Normal View History

import base64
import io
def encode(buffer: io.BytesIO) -> str:
"""
Encode the given buffer as base64.
"""
return base64.encodebytes(buffer.getvalue()).decode("ascii")