Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Efficient representation for small bytearrays with 128 or 256 bits.
- data Word128 = Word128 {
- w128_first :: !Word64
- w128_second :: !Word64
- data Word256 = Word256 {
- w256_first :: !Word128
- w256_second :: !Word128
- bsToW128 :: ByteString -> Word128
- w128ToBs :: Word128 -> ByteString
- bsToW256 :: ByteString -> Word256
- w256ToBs :: Word256 -> ByteString
- xorW128 :: Word128 -> Word128 -> Word128
- xorW256 :: Word256 -> Word256 -> Word256
Documentation
Word128 | |
|
Word256 | |
|
bsToW128 :: ByteString -> Word128 Source #
Converts a ByteString
into a Word128
. Only the first 16 bytes
are taken into account, the rest is ignored.
w128ToBs :: Word128 -> ByteString Source #
bsToW256 :: ByteString -> Word256 Source #
Converts a ByteString
into a Word256
. Only the first 32 bytes
are taken into account, the rest is ignored.
w256ToBs :: Word256 -> ByteString Source #