@hackage hex-text0.1.0.0
ByteString-Text hexidecimal conversions
Categories
License
Apache-2.0
Maintainer
Chris Martin, Julie Moronuki
Links
Versions
Installation
Dependencies (4)
- base >=4.7 && <5
- base16-bytestring <1
- bytestring
- text Show all…
Dependents (14)
@hackage/electrs-client, @hackage/morley, @hackage/spade, @hackage/morley-client, @hackage/acme-everything, @hackage/covenant, Show all…
hex-text
hex-text is a small library for converting between ByteStrings and their representations as hexidecimal numbers encoded as Text.
A ByteString is a list of bytes. A byte is a number between 0 and 255, represented by the Word8 type. In a fixed-width hexidecimal representation, the lowest byte 0 is represented by the hex string 00, and the greatest byte 255 is represented by the hex string ff. So, for example, the ByteString consisting of bytes [ 1, 2, 3, 253, 254, 255 ] is represented as 010203fdfeff.
λ> import Text.Hex (encodeHex)
λ> import Data.ByteString (pack)
λ> (encodeHex . pack) [1, 2, 3, 253, 254, 255]
"010203fdfeff"