haskell / base16-bytestring

Fast base16 (hexadecimal) encoding and decoding for Haskell bytestrings.
Other
27 stars 10 forks source link

Fix for off-by-one error in handling of upper-case input (issue #2) #3

Closed loisch closed 11 years ago

loisch commented 12 years ago

Verified in the following interactive session: $ ghci -package QuickCheck Data/ByteString/Base16.hs

let prop x = fst (decode (encode (Data.ByteString.Char8.pack x))) == Data.ByteString.Char8.pack x Test.QuickCheck.quickCheck prop
+++ OK, passed 100 tests. let prop2 x = fst (decode (Data.ByteString.Char8.map Data.Char.toUpper (encode (Data.ByteString.Char8.pack x)))) == Data.ByteString.Char8.pack x Test.QuickCheck.quickCheck prop2
+++ OK, passed 100 tests.

joeyadams commented 11 years ago

Would you mind releasing this to Hackage? This is a pretty nasty bug to leave out there.