bits-bytestring alternatives and similar packages
Based on the "bits" category.
Alternatively, view bits-bytestring alternatives based on common mentions on social networks and blogs.
Do you think we are missing an alternative of bits-bytestring or a related project?
ByteString instance for the
Bits typeclass, providing bitwise operators for n-bit blocks larger than
To install bits-bytestring, use stack and add
bits-bytestring to your cabal file or just run:
stack install bits-bytestring
bits-bytestring provides a
Bits typeclass instance for
ByteString, so all the bitwise operators from
Data.Bits are available with
ByteStrings now. To access the instance, import
Data.Bits.ByteString. Example usage could be:
-- Minimal imports import qualified Data.ByteString as B import Data.Bits import Data.Bits.ByteString -- cryptohash example import qualified Crypto.Hash.SHA512 as SHA512 main :: IO () main = do let bs1 = SHA512.hash (B.pack [0..255]) let bs2 = (B.replicate 64 0) print $ bs1 .&. bs2 print $ bs1 .|. bs2 print $ bs1 `xor` bs2 print $ shift bs1 5 print $ rotate bs1 13
Pull requests and bug reports are welcome!
If you need to contact me, the following ways are best and in this order: