Look up the value of a Base64 character code, e.g.,
This is our lowest level decoding function. It's just an array lookup. Codes for characters that aren't part of the Base64 alphabet are mapped to NIL.
Function:
(defun b64-value-from-code$inline (code) (declare (type (unsigned-byte 8) code)) (let ((acl2::__function__ 'b64-value-from-code)) (declare (ignorable acl2::__function__)) (aref1 '*b64-vals-from-codes-array* *b64-vals-from-codes-array* (lnfix code))))
Theorem:
(defthm return-type-of-b64-value-from-code (b* ((value (b64-value-from-code$inline code))) (or (not value) (natp value))) :rule-classes :type-prescription)
Theorem:
(defthm unsigned-byte-p-6-of-b64-value-from-code (iff (unsigned-byte-p 6 (b64-value-from-code code)) (b64-value-from-code code)))
Theorem:
(defthm b64-value-from-code-of-b64-char-from-value (implies (unsigned-byte-p 6 value) (equal (b64-value-from-code (char-code (b64-char-from-value value))) value)))