Add fromText
function
This commit is contained in:
parent
8c634d8aa6
commit
fd70a681dc
1 changed files with 4 additions and 0 deletions
|
@ -80,6 +80,10 @@ fromBytes = hexString . BS16.encode
|
||||||
toBytes :: HexString -> BS.ByteString
|
toBytes :: HexString -> BS.ByteString
|
||||||
toBytes (HexString bs) = BS16.decodeLenient bs
|
toBytes (HexString bs) = BS16.decodeLenient bs
|
||||||
|
|
||||||
|
-- | Reads a human-readable hex string into a `HexString`
|
||||||
|
fromText :: T.Text -> HexString
|
||||||
|
fromText = hexString . TE.encodeUtf8
|
||||||
|
|
||||||
-- | Access to a 'T.Text' representation of the 'HexString'
|
-- | Access to a 'T.Text' representation of the 'HexString'
|
||||||
toText :: HexString -> T.Text
|
toText :: HexString -> T.Text
|
||||||
toText (HexString bs) = TE.decodeUtf8 bs
|
toText (HexString bs) = TE.decodeUtf8 bs
|
||||||
|
|
Loading…
Reference in a new issue