Convert a list of natural numbers below 256 to a string of hexadecimal digits.
(ubyte8s=>hexstring bytes) → string
Each input natural number is converted to two hexadecimal digits, with a leading 0 digit if needed. The hexadecimal digits above 9 are upper case letters. The result is the string of all these digits. The result has always an even length.
Function:
(defun ubyte8s=>hexstring (bytes) (declare (xargs :guard (unsigned-byte-listp 8 bytes))) (let ((__function__ 'ubyte8s=>hexstring)) (declare (ignorable __function__)) (implode (ubyte8s=>hexchars bytes))))
Theorem:
(defthm hex-digit-string-p-of-ubyte8s=>hexstring (b* ((string (ubyte8s=>hexstring bytes))) (str::hex-digit-string-p string)) :rule-classes :rewrite)
Theorem:
(defthm ubyte8s=>hexstring-of-unsigned-byte-list-fix (equal (ubyte8s=>hexstring (unsigned-byte-list-fix 8 bytes)) (ubyte8s=>hexstring bytes)))
Theorem:
(defthm evenp-of-length-of-ubyte8s=>hexstring (evenp (length (ubyte8s=>hexstring bytes))))
Theorem:
(defthm ubyte8s=>hexstring-of-append (equal (ubyte8s=>hexstring (append bytes1 bytes2)) (string-append (ubyte8s=>hexstring bytes1) (ubyte8s=>hexstring bytes2))))