Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data HexString
- hexString :: ByteString -> HexString
- fromBinary :: Binary a => a -> HexString
- toBinary :: Binary a => HexString -> a
- fromBytes :: ByteString -> HexString
- toBytes :: HexString -> ByteString
- toText :: HexString -> Text
Documentation
Represents a Hex string. Guarantees that all characters it contains are valid hex characters.
hexString :: ByteString -> HexString Source
Smart constructor which validates that all the text are actually hexadecimal characters.
fromBytes :: ByteString -> HexString Source
Reads a ByteString
as raw bytes and converts to hex representation. We
cannot use the instance Binary of ByteString
because it provides
a leading length, which is not what we want when dealing with raw bytes.
toBytes :: HexString -> ByteString Source
Access to the raw bytes in a ByteString
format.