diff options
author | Yann Herklotz <git@yannherklotz.com> | 2021-05-19 22:13:13 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2021-05-19 22:13:13 +0100 |
commit | 17796b3ff9bcab6547f49a62b47ed244a8b01571 (patch) | |
tree | 7281b70ac2abb077e451c3597d5c249f2ab8b806 | |
parent | fe60271a6a57955497ca96127916f96f1ee6e20c (diff) | |
download | verismith-17796b3ff9bcab6547f49a62b47ed244a8b01571.tar.gz verismith-17796b3ff9bcab6547f49a62b47ed244a8b01571.zip |
Add showBS to Utils
-rw-r--r-- | src/Verismith/Utils.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Verismith/Utils.hs b/src/Verismith/Utils.hs index 0faf585..73a1c4c 100644 --- a/src/Verismith/Utils.hs +++ b/src/Verismith/Utils.hs @@ -11,6 +11,12 @@ module Verismith.Utils ) where +import qualified Data.ByteString.Lazy as L +import Data.Text (Text) +import qualified Data.Text as T +import Data.Text.Encoding (decodeUtf8) +import qualified Data.Text.IO as T +import Data.ByteString.Builder (byteStringHex, toLazyByteString) import Data.ByteString (ByteString, pack) import System.Random (mkStdGen, newStdGen, randoms) @@ -27,3 +33,6 @@ generateByteString mseed size n = do repeatedly f as = b : repeatedly f as' where (b, as') = f as + +showBS :: ByteString -> Text +showBS = decodeUtf8 . L.toStrict . toLazyByteString . byteStringHex |