Skip to content

Commit

Permalink
Use hashWithSalt to guarantee consistent hashing across runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Peaker committed Jan 1, 2013
1 parent 2aeda53 commit 5ffed1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Database/KeyValueHash.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Data.Binary.Get (runGet)
import Data.Binary.Put (runPut)
import Data.Derive.Binary(makeBinary)
import Data.DeriveTH(derive)
import Data.Hashable (hash)
import Data.Hashable (hashWithSalt)
import Data.List (intercalate)
import Data.Monoid (mconcat)
import Data.Typeable (Typeable)
Expand Down Expand Up @@ -67,7 +67,7 @@ mkHashFunc name f = HashFunction
}

stdHash :: HashFunction
stdHash = mkHashFunc "Hashable" (fromIntegral . hash)
stdHash = mkHashFunc "Hashable" (fromIntegral . hashWithSalt 0xDEADBEEF)

type ValuePtr = Word64 -- offset in values file
type KeyPtr = Word64 -- index in key file
Expand Down

0 comments on commit 5ffed1a

Please sign in to comment.