Function: decode-hex-string
decode-hex-string is a byte-compiled function defined in
hex-util.el.gz.
Signature
(decode-hex-string STRING)
Documentation
Decode hexadecimal STRING to octet string.
Source Code
;; Defined in /usr/src/emacs/lisp/hex-util.el.gz
(defun decode-hex-string (string)
"Decode hexadecimal STRING to octet string."
(let* ((len (length string))
(dst (make-string (/ len 2) 0))
(idx 0)(pos 0))
(while (< pos len)
;; logior and ash are not byte-coded.
;; (aset dst idx (logior (ash (hex-char-to-num (aref string pos)) 4)
;; (hex-char-to-num (aref string (1+ pos)))))
(aset dst idx (+ (* (hex-char-to-num (aref string pos)) 16)
(hex-char-to-num (aref string (1+ pos)))))
(setq idx (1+ idx)
pos (+ 2 pos)))
dst))