Implementation details of base64 encoding/decoding.
These routines should generally not be used directly, and may be
changed in future versions of the library.
Here are some naming conventions used throughout these functions:
- chars refer to actual ACL2::characters, which typically will
be in the Base64 alphabet, i.e., A-Z, a-z, 0-9, +, and
/. Of course, when decoding, data might be coming from some external
source; it might contain pad characters = or even arbitrary, invalid
characters from beyond the Base64 alphabet.
- codes refer to actual char-codes, with the usual
correspondence to chars.
- values refer to the interpretation of each Base64 character as a
numeric value. For instance, the value of #\A is 0; the value of #\B
is 1, and so on. In our representation, the values are exactly the 64 natural
numbers from 0-63, and can be recognized with, e.g., (unsigned-byte-p 6
- bytes refer to ordinary 8-bit bytes, which typically will be part of
the original, un-encoded data.
- Decode 4 base-64 values into 3 bytes.
- Encode 3 bytes into 4 base-64 characters.
- Decode 3 arbitrary characters from 4 base-64 characters.
- Efficient, string-based version of b64-decode-list-impl.
- Decode three base-64 characters to recover 2 arbitrary characters.
- Encode the last group of (up to three) characters.
- Look up the value of a Base64 character code, e.g., (char-code
#\A) → 0.
- Encode 3 arbitrary characters into 4 base-64 characters.
- Encode 2 final characters into base-64 characters.
- Decode the final group of base-64 encoded characters into 1-3 characters.
- Decode two base-64 characters to recover 1 arbitrary character.
- Tail-recursive version of base64-decode-list.
- Efficient, string-based version of b64-encode-list-impl.
- String-based version of b64-encode-last-group.
- Encode 1 final character into base-64 characters.
- Look up the Base64 character for a value, e.g., 0 → #\A.
- Tail-recursive version of base64-encode-list.