Copyright | (c) 2017 Henri Verroken |
---|---|
License | BSD3 |
Maintainer | Henri Verroken <henriverroken@gmail.com |
Stability | stable |
Safe Haskell | None |
Language | Haskell2010 |
This module provides bindings to the xxHash64 and the xxHash32 algorithm.
The C implementation used is directly taken from https://github.com/Cyan4973/xxHash.
- class XXHash t where
- c_xxh64 :: Ptr a -> CSize -> CULLong -> CULLong
- c_xxh32 :: Ptr a -> CSize -> CUInt -> CUInt
- data XXH32State
- c_xxh32_createState :: IO (Ptr XXH32State)
- c_xxh32_freeState :: Ptr XXH32State -> IO ()
- c_xxh32_copyState :: Ptr XXH32State -> Ptr XXH32State -> IO ()
- c_xxh32_reset :: Ptr XXH32State -> CUInt -> IO ()
- c_xxh32_update :: Ptr XXH32State -> Ptr a -> CSize -> IO ()
- c_xxh32_digest :: Ptr XXH32State -> IO CUInt
- data XXH64State
- c_xxh64_createState :: IO (Ptr XXH64State)
- c_xxh64_freeState :: Ptr XXH64State -> IO ()
- c_xxh64_copyState :: Ptr XXH64State -> Ptr XXH64State -> IO ()
- c_xxh64_reset :: Ptr XXH64State -> CULLong -> IO ()
- c_xxh64_update :: Ptr XXH64State -> Ptr a -> CSize -> IO ()
- c_xxh64_digest :: Ptr XXH64State -> IO CULLong
Interface
Class for hashable data types.
Not that all standard instances are specialized using the SPECIALIZE
pragma.
C Interface
Direct Calculation
32-bit state functions
data XXH32State Source #
:: IO (Ptr XXH32State) | Pointer to a newly allocated state |
:: Ptr XXH32State | |
-> IO () | Free pointer allocated by |
:: Ptr XXH32State | Destination |
-> Ptr XXH32State | Source |
-> IO () |
:: Ptr XXH32State | The state to reset |
-> CUInt | The initial seed |
-> IO () |
:: Ptr XXH32State | The state to digest |
-> IO CUInt | Resulting hash |
64-bit state functions
data XXH64State Source #
:: IO (Ptr XXH64State) | Pointer to a newly allocated state |
:: Ptr XXH64State | |
-> IO () | Free pointer allocated by |
:: Ptr XXH64State | Destination |
-> Ptr XXH64State | Source |
-> IO () |
:: Ptr XXH64State | The state to reset |
-> CULLong | The initial seed |
-> IO () |
:: Ptr XXH64State | The state to digest |
-> IO CULLong | Resulting hash |