hexstring-0.11.1: Fast and safe representation of a hex string

Safe HaskellNone
LanguageHaskell2010

Data.HexString

Synopsis

Documentation

hexString :: ByteString -> HexString #

Smart constructor which validates that all the text are actually hexadecimal characters.

fromBinary :: Binary a => a -> HexString #

Converts a Binary to a HexString value

toBinary :: Binary a => HexString -> a #

Converts a HexString to a Binary value

fromBytes :: ByteString -> HexString #

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 #

Access to the raw bytes in a ByteString format.

toText :: HexString -> Text #

Access to a Text representation of the HexString