Module

Contract.Prim.ByteArray

Our domain type for byte arrays, a wrapper over Uint8Array.

#rawBytesToByteArray

#rawBytesFromByteArray

#rawBytesToIntArray

#rawBytesFromIntArray

#rawBytesFromIntArrayUnsafe

#rawBytesFromAscii

#rawBytesToHex

#hexToRawBytes

#hexToRawBytesUnsafe

Re-exports from Cardano.Types.CborBytes

Re-exports from Cardano.Types.RawBytes

Re-exports from Data.ByteArray

#hexToByteArrayUnsafe

hexToByteArrayUnsafe :: String -> ByteArray

Characters not in range will be converted to zero.

#hexToByteArray

hexToByteArray :: String -> Maybe ByteArray

Input string must consist of hexadecimal numbers. Length of the input string must be even (2 characters per byte).

#byteLength

#byteArrayToIntArray

#byteArrayToHex

#byteArrayFromIntArrayUnsafe

byteArrayFromIntArrayUnsafe :: Array Int -> ByteArray

Overflowing integers will be silently accepted modulo 256.

#byteArrayFromIntArray

byteArrayFromIntArray :: Array Int -> Maybe ByteArray

A safer version of byteArrayFromIntArrayUnsafe that checks that elements are in range 0-255.

#byteArrayFromAscii

byteArrayFromAscii :: String -> Maybe ByteArray

Convert characters in range 0-255 into a ByteArray. Fails with Nothing if there are characters out of this range in a string.

Modules