tahoe-chk-0.2.0.0: The Tahoe-LAFS' Content-Hash-Key (CHK) cryptographic protocol.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Tahoe.Util

Synopsis

Documentation

nextMultipleOf :: (Integral m, Integral v) => m -> v -> v Source #

The smallest multiple of multiplier which is >= value.

nextPowerOf :: (Ord p, Num p) => p -> p -> p Source #

Return the smallest integer which is a power of k and greater than or equal to n

toBinary :: a -> a -> Int -> [a] Source #

Construct a binary representation of the given integer. The first argument represents a zero bit. The second argument represents a one bit. The result is ordered from most to least significant bit.

chunkedBy Source #

Arguments

:: Int

The number of bytes in each piece.

-> ByteString

The byte string to break up.

-> [ByteString] 

Break up a byte string into equal sized pieces, except the last piece which might be short. *BS.concat . chunkedBy n == id*

ceilDiv :: Integral i => i -> i -> i Source #

Integer division rounded towards positive infinity.