crypto-api-0.10.1: A generic interface for cryptographic operations

Safe HaskellSafe-Infered

Crypto.Util

Description

A small selection of utilities that might be of use to others working with bytestring/number combinations.

Synopsis

Documentation

incBS :: ByteString -> ByteStringSource

incBS bs inefficiently computes the value i2bs (8 * B.length bs) (bs2i bs + 1)

i2bs :: Int -> Integer -> ByteStringSource

i2bs bitLen i converts i to a ByteString of bitLen bits (must be a multiple of 8).

bs2i :: ByteString -> IntegerSource

bs2i bs converts the ByteString bs to an Integer (inverse of i2bs)