base64_alphabet() =
65..90 | 97..122 | 48..57 | 43 | 47 | 45 | 95 | 61
base64_alphabet() =
65..90 | 97..122 | 48..57 | 43 | 47 | 45 | 95 | 61
Base 64 Encoding alphabet, see RFC 4648.
Provides base64 encode and decode, see RFC 2045.
base64_alphabet() =
65..90 | 97..122 | 48..57 | 43 | 47 | 45 | 95 | 61
Base 64 Encoding alphabet, see RFC 4648.
base64_mode() = standard | urlsafeoptions() = #{padding => boolean(), mode => base64_mode()}Customises the behaviour of the encode and decode functions. Default value if omitted entirely or partially is #{mode => standard, padding => true}.
Base 64 encoded string.
base64_binary() = binary()Base 64 encoded binary.
byte_string() = [byte()]Arbitrary sequences of octets.
decode(Base64) -> Data decode_to_string(Base64) -> DataString mime_decode(Base64) -> Data mime_decode_to_string(Base64) -> DataString Decodes a base64 string encoded using the standard alphabet according to RFC 4648 Section 4 to plain ASCII.
mime_decode/1 and mime_decode_to_string/1 strip away illegal characters, while decode/1 and decode_to_string/1 only strip away whitespace characters.
Checks the correct number of = padding characters at the end of the encoded string.
decode(Base64, Options) -> Datadecode_to_string(Base64, Options) -> DataStringmime_decode(Base64, Options) -> Datamime_decode_to_string(Base64, Options) -> DataStringBase64 = base64_string() | base64_binary()Options = options()Data = binary()DataString = byte_string()Decodes a base64 string encoded using the alphabet indicated by the mode option to plain ASCII.
mime_decode/2 and mime_decode_to_string/2 strip away illegal characters, while decode/2 and decode_to_string/2 only strip away whitespace characters.
The mode option can be one of the following:
standardRFC 4648 Section 4, that is "+" and "/" are representing bytes 62 and 63 respectively, while "-" and "_" are illegal characters.urlsafeRFC 4648 Section 5, that is "-" and "_" are representing bytes 62 and 63 respectively, while "+" and "/" are illegal characters.The padding option can be one of the following:
true= padding characters at the end of the encoded string.false= padding characters at the end.encode(Data) -> Base64 encode_to_string(Data) -> Base64String Encodes a plain ASCII string into base64 using the standard alphabet according to RFC 4648 Section 4. The result is 33% larger than the data.
Always appends correct number of = padding characters to the encoded string.
encode(Data, Options) -> Base64encode_to_string(Data, Options) -> Base64StringData = byte_string() | binary()Options = options()Base64 = base64_binary()Base64String = base64_string()Encodes a plain ASCII string into base64 using the alphabet indicated by the mode option. The result is 33% larger than the data.
The mode option can be one of the following:
standardRFC 4648 Section 4.urlsafeRFC 4648 Section 5.The padding option can be one of the following:
true= padding characters to the encoded string.false= padding characters to the encoded string.
© 2010–2023 Ericsson AB
Licensed under the Apache License, Version 2.0.