(lambda ()
(error:bad-range-argument string 'HEXADECIMAL->VECTOR-8B))))
(define-integrable (hex-digit char)
- (let ((d
- (fix:- (char->integer char)
- (char->integer #\0))))
- (if (not (and (fix:<= 0 d) (fix:< d 16)))
- (lose))
- d))
+ (let ((integer (char->integer char)))
+ (let ((numeric-digit (fix:- integer (char->integer #\0)))
+ (lowercase-digit (fix:- integer (char->integer #\a)))
+ (uppercase-digit (fix:- integer (char->integer #\A))))
+ (cond ((fix:< numeric-digit #d10) numeric-digit)
+ ((fix:< lowercase-digit 6) (fix:+ lowercase-digit #d10))
+ ((fix:< uppercase-digit 6) (fix:+ uppercase-digit #d10))
+ (else (lose))))))
(if (not (fix:= (fix:and end 1) 0))
(lose))
(let ((bytes (make-vector-8b (fix:lsh end -1))))