fix hex conversion
closes PR 13335
This commit is contained in:
parent
5470899d6e
commit
27e9988226
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user