Portability | good |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <[email protected]> |
Safe Haskell | None |
Data.Byteable
Description
- class Byteable a where
- toBytes :: a -> ByteString
- constEqBytes :: Byteable a => a -> a -> Bool
Documentation
Class of things that can generate sequence of bytes
Methods
toBytes :: a -> ByteStringSource
Instances
constEqBytes :: Byteable a => a -> a -> BoolSource
A constant time equality test for 2 byteable objects.
If objects are of 2 different sizes, the function will abort early without comparing any bytes.
compared to == , this function will go over all the bytes present before yielding a result even when knowing the overall result early in the processing.