hs-abci-types-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Data.ByteArray.HexString

Synopsis

Documentation

newtype HexString Source #

Represents a Hex string. Guarantees that all characters it contains are valid hex characters.

Constructors

HexString 
Instances
Eq HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Ord HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Show HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

IsString HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Generic HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Associated Types

type Rep HexString :: Type -> Type #

Semigroup HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Monoid HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

FromJSON HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Methods

parseJSON :: Value -> Parser HexString

parseJSONList :: Value -> Parser [HexString]

ToJSON HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Methods

toJSON :: HexString -> Value

toEncoding :: HexString -> Encoding

toJSONList :: [HexString] -> Value

toEncodingList :: [HexString] -> Encoding

ByteArray HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Methods

allocRet :: Int -> (Ptr p -> IO a) -> IO (a, HexString)

ByteArrayAccess HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

Methods

length :: HexString -> Int

withByteArray :: HexString -> (Ptr p -> IO a) -> IO a

copyByteArrayToPtr :: HexString -> Ptr p -> IO ()

type Rep HexString Source # 
Instance details

Defined in Data.ByteArray.HexString

type Rep HexString = D1 (MetaData "HexString" "Data.ByteArray.HexString" "hs-abci-types-0.1.0.0-CSbCBfElGIr9n2xrkSCrY5" True) (C1 (MetaCons "HexString" PrefixI True) (S1 (MetaSel (Just "unHexString") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

hexString :: ByteArray ba => ba -> Either String HexString Source #

Smart constructor which trims '0x' and validates length is even. Works with any mixed casing of characters: `hexString "0xAA" == hexString "0xAa" == hexString "0xaA" == hexString "0xaa"`

fromBytes :: ByteArrayAccess ba => ba -> HexString Source #

Reads a raw bytes and converts to hex representation.

toBytes :: ByteArray ba => HexString -> ba Source #

Access to the raw bytes of HexString.

toText :: HexString -> Text Source #

Access to a Text representation of the HexString

format :: HexString -> Text Source #

Access to a Text representation of the HexString