fix hex conversion

closes PR 13335
This commit is contained in:
Ryan Culpepper 2012-12-01 10:12:23 -05:00
parent 5470899d6e
commit 27e9988226

View File

@ -597,9 +597,9 @@
(cond [(<= (char->integer #\0) c (char->integer #\9))
(- c (char->integer #\0))]
[(<= (char->integer #\a) c (char->integer #\f))
(- c (char->integer #\a))]
(+ 10 (- c (char->integer #\a)))]
[(<= (char->integer #\A) c (char->integer #\F))
(- c (char->integer #\A))])))
(+ 10 (- c (char->integer #\A)))])))
(unless (and (string? s) (even? (string-length s))
(regexp-match? #rx"[0-9a-zA-Z]*" s))
(raise-type-error 'hex-string->bytes