xxhash-ffi-0.1.0.1: Bindings to the C implementation the xxHash algorithm

Copyright(c) 2017 Henri Verroken
LicenseBSD3
MaintainerHenri Verroken <henriverroken@gmail.com
Stabilitystable
Safe HaskellNone
LanguageHaskell2010

Data.Digest.XXHash.FFI

Contents

Description

This module provides bindings to the xxHash64 and the xxHash32 algorithm.

The C implementation used is directly taken from https://github.com/Cyan4973/xxHash.

Synopsis

Interface

class XXHash t where Source #

Class for hashable data types.

Not that all standard instances are specialized using the SPECIALIZE pragma.

Minimal complete definition

xxh32, xxh64

Methods

xxh32 :: t -> Word32 -> Word32 Source #

Calculate the 32-bit xxHash using a given seed.

xxh64 :: t -> Word64 -> Word64 Source #

Calculate the 64-bit xxHash using a given seed.

C Interface

Direct Calculation

c_xxh64 Source #

Arguments

:: Ptr a

Ptr to the input buffer

-> CSize

Buffer length

-> CULLong

Seed

-> CULLong

Resulting hash

c_xxh32 Source #

Arguments

:: Ptr a

Ptr to the input buffer

-> CSize

Buffer length

-> CUInt

Seed

-> CUInt

Resulting hash

32-bit state functions

c_xxh32_createState Source #

Arguments

:: IO (Ptr XXH32State)

Pointer to a newly allocated state

c_xxh32_freeState Source #

Arguments

:: Ptr XXH32State 
-> IO ()

Free pointer allocated by c_xxh32_createState

c_xxh32_copyState Source #

Arguments

:: Ptr XXH32State

Destination

-> Ptr XXH32State

Source

-> IO () 

c_xxh32_reset Source #

Arguments

:: Ptr XXH32State

The state to reset

-> CUInt

The initial seed

-> IO () 

c_xxh32_update Source #

Arguments

:: Ptr XXH32State

The state to update

-> Ptr a

Ptr to the input buffer

-> CSize

Buffer length

-> IO () 

c_xxh32_digest Source #

Arguments

:: Ptr XXH32State

The state to digest

-> IO CUInt

Resulting hash

64-bit state functions

c_xxh64_createState Source #

Arguments

:: IO (Ptr XXH64State)

Pointer to a newly allocated state

c_xxh64_freeState Source #

Arguments

:: Ptr XXH64State 
-> IO ()

Free pointer allocated by c_xxh64_createState

c_xxh64_copyState Source #

Arguments

:: Ptr XXH64State

Destination

-> Ptr XXH64State

Source

-> IO () 

c_xxh64_reset Source #

Arguments

:: Ptr XXH64State

The state to reset

-> CULLong

The initial seed

-> IO () 

c_xxh64_update Source #

Arguments

:: Ptr XXH64State

The state to update

-> Ptr a

Ptr to the input buffer

-> CSize

Buffer length

-> IO () 

c_xxh64_digest Source #

Arguments

:: Ptr XXH64State

The state to digest

-> IO CULLong

Resulting hash