• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
          • Base64-impl
            • B64-bytes-from-vals
            • B64-vals-from-bytes
            • B64-dec3
            • B64-decode-str-impl
            • B64-dec2
            • B64-encode-last-group
            • B64-value-from-code
            • B64-enc3
            • B64-enc2
            • B64-decode-last-group
            • B64-dec1
            • B64-decode-list-impl
            • B64-encode-str-impl
            • B64-encode-last-group-str
            • B64-enc1
            • B64-char-from-value
              • *b64-chars-from-vals-array*
            • B64-encode-list-impl
          • Base64-decode-list
          • Base64-decode
          • Base64-encode-list
          • Base64-revappend-decode
          • Base64-revappend-encode
          • Base64-encode
        • Charset-p
        • Strtok!
        • Cases
        • Concatenation
        • Character-kinds
        • Html-encoding
        • Substrings
        • Strtok
        • Equivalences
        • Url-encoding
        • Lines
        • Explode-implode-equalities
        • Ordering
        • Numbers
        • Pad-trim
        • Coercion
        • Std/strings/digit-to-char
        • Substitution
        • Symbols
      • Std/osets
      • Std/io
      • Std/basic
      • Std/system
      • Std/typed-lists
      • Std/bitsets
      • Std/testing
      • Std/typed-alists
      • Std/stobjs
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Base64-impl

B64-char-from-value

Look up the Base64 character for a value, e.g., 0 → #\A.

Signature
(b64-char-from-value value) → char
Returns
char — Type (characterp char).

This is our lowest level encoding function. It's just an array lookup.

Definitions and Theorems

Function: b64-char-from-value$inline

(defun b64-char-from-value$inline (value)
  (declare (type (unsigned-byte 6) value))
  (let ((acl2::__function__ 'b64-char-from-value))
    (declare (ignorable acl2::__function__))
    (the character
         (aref1 '*b64-chars-from-vals-array*
                *b64-chars-from-vals-array* value))))

Theorem: characterp-of-b64-char-from-value

(defthm characterp-of-b64-char-from-value
  (b* ((char (b64-char-from-value$inline value)))
    (characterp char))
  :rule-classes :type-prescription)

Theorem: b64-char-from-value-never-produces-a-pad

(defthm b64-char-from-value-never-produces-a-pad
  (not (equal (b64-char-from-value value)
              #\=)))

Subtopics

*b64-chars-from-vals-array*
Array mapping each value to its associated character.