MIT licensed by Chris Martin
Maintained by Chris Martin, Julie Moronuki
This version can be pinned in stack with:hex-text-0.1.0.9@sha256:088bcf00a2edf5d45c671ce0bdd652c1b4c71fc0ed5888557408f0dd04e6c454,1207

Module documentation for 0.1.0.9

hex-text

hex-text is a small library for converting between ByteStrings and their representations as hexidecimal numbers encoded as Text.

Motivation

When using Stripe for payments, Stripe sends a signature as a hexidecimal Text value. The cryptonite package can be used to verify the signature, but it requires ByteString values, not Text.

Example usage

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"

Changes

0.1.0.9 (2023-06-21)

Miscellaneous cleanup and updates

0.1.0.8 (2022-12-31)

Switch testing to hspec

Raise minimum required GHC to 8.10

0.1.0.7 (2022-11-10)

Start of changelog