bytes.to_base64

bytes.to_base64

bytes.to_base64

Function

Convert Bytes to Base64 text.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
modeString/IntNoStandard Base64Optional standard_no_pad, url_safe, url_safe_no_pad, also compatible with base64 library's 0 to 3 numeric mode.

Return value

TypeDescription
StringBase64 text.

Code Example

Notes

  • To parse Base64 use bytes(text, 'base64') or bytes({base64: text}).