{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.Hash.Internal.Utils
( B16ShortByteString(..)
) where
import qualified Data.ByteString.Short as BS
import Text.Printf
newtype B16ShortByteString = B16ShortByteString BS.ShortByteString
instance Show B16ShortByteString where
show :: B16ShortByteString -> String
show (B16ShortByteString ShortByteString
b) = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (forall r. PrintfType r => String -> r
printf String
"%0.2x") forall a b. (a -> b) -> a -> b
$ ShortByteString -> [Word8]
BS.unpack ShortByteString
b