Idris2Doc : Data.String.Base64.Decode

Data.String.Base64.Decode

(source)

Definitions

base64DecodeLength : Int->Int
  Given the length of Base64 encoded data, calculate the maximum possible
length of the decoded data.

The result is an upper bound and does not account for padding characters.

The actual decoded length may therefore be smaller.

Visibility: export
base64DecodeBits8 : ListBits8->Maybe (ListBits8)
  Decode a list of Base64 bytes into its original bytes.

Returns `Nothing` if the input is not valid Base64.

The source list is copied once into an immutable `IBuffer`, after which
decoding operates entirely on the array library's indexed buffer types.

The decoder allocates a mutable output buffer inside an `F1` region,
processes complete quartets using the optimized `d0a` through `d3a`
lookup tables, freezes only the successfully written output prefix, and
finally converts that prefix to `List Bits8`.

Visibility: export
base64DecodeString : String->Maybe (ListBits8)
  Decode a Base64 String into its original bytes.

The String is converted directly to an immutable UTF-8 byte buffer using
the array library's `fromString` operation.

Since Base64 is ASCII-only, valid Base64 text has the same byte
representation in UTF-8. Any non-Base64 UTF-8 byte is rejected by the
optimized decoder tables.

Returns `Nothing` when the input is not valid Base64.

Visibility: export