hex-text: ByteString-Text hexidecimal conversions

[ apache, library, text ] [ Propose Tags ]

Encode a ByteString as a hexidecimal Text value, or decode hexidecimal Text as a ByteString.

[Skip to Readme]
Versions [faq]
Dependencies base (>=4.7 && <5), base16-bytestring, bytestring, text [details]
License Apache-2.0
Copyright 2018 Typeclass Consulting, LLC
Author Chris Martin
Maintainer Chris Martin, Julie Moronuki
Category Text
Home page https://github.com/typeclasses/hex-text
Bug tracker https://github.com/typeclasses/hex-text/issues
Source repo head: git clone https://github.com/typeclasses/hex-text
Uploaded by chris_martin at 2018-02-25T20:17:49Z
Distributions NixOS:
Downloads 712 total (36 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-02-25 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for hex-text-

[back to package description]


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]