module Data.ByteString.Short.Base16
( encodeBase16
, encodeBase16'
, decodeBase16
, decodeBase16'
, decodeBase16Untyped
, decodeBase16Lenient
, isBase16
, isValidBase16
) where
import Data.Base16.Types
import Data.ByteString.Short
import Data.ByteString.Base16.Internal.Head
import qualified Data.ByteString.Base16 as B16
import Data.Text (Text)
import Data.Text.Short
import Data.Text.Short.Unsafe
encodeBase16 :: ShortByteString -> Base16 ShortText
encodeBase16 :: ShortByteString -> Base16 ShortText
encodeBase16 = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ShortByteString -> ShortText
fromShortByteStringUnsafe forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShortByteString -> Base16 ShortByteString
encodeBase16'
{-# INLINE encodeBase16 #-}
encodeBase16' :: ShortByteString -> Base16 ShortByteString
encodeBase16' :: ShortByteString -> Base16 ShortByteString
encodeBase16' = forall a. a -> Base16 a
assertBase16 forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShortByteString -> ShortByteString
encodeBase16Short_
{-# INLINE encodeBase16' #-}
decodeBase16 :: Base16 ShortByteString -> ShortByteString
decodeBase16 :: Base16 ShortByteString -> ShortByteString
decodeBase16 = Base16 ShortByteString -> ShortByteString
decodeBase16ShortTyped_
{-# INLINE decodeBase16 #-}
decodeBase16' :: Base16 ShortText -> ShortByteString
decodeBase16' :: Base16 ShortText -> ShortByteString
decodeBase16' = Base16 ShortByteString -> ShortByteString
decodeBase16 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ShortText -> ShortByteString
toShortByteString
{-# INLINE decodeBase16' #-}
decodeBase16Untyped :: ShortByteString -> Either Text ShortByteString
decodeBase16Untyped :: ShortByteString -> Either Text ShortByteString
decodeBase16Untyped = ShortByteString -> Either Text ShortByteString
decodeBase16Short_
{-# INLINE decodeBase16Untyped #-}
decodeBase16Lenient :: ShortByteString -> ShortByteString
decodeBase16Lenient :: ShortByteString -> ShortByteString
decodeBase16Lenient = ShortByteString -> ShortByteString
decodeBase16ShortLenient_
{-# INLINE decodeBase16Lenient #-}
isBase16 :: ShortByteString -> Bool
isBase16 :: ShortByteString -> Bool
isBase16 = ByteString -> Bool
B16.isBase16 forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShortByteString -> ByteString
fromShort
{-# INLINE isBase16 #-}
isValidBase16 :: ShortByteString -> Bool
isValidBase16 :: ShortByteString -> Bool
isValidBase16 = ByteString -> Bool
B16.isValidBase16 forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShortByteString -> ByteString
fromShort
{-# INLINE isValidBase16 #-}