Skip to content

Commit

Permalink
Rename TMurmurHashes -> MurmurHashes (output of murmur_hash() proc). …
Browse files Browse the repository at this point in the history
…Bump to v0.1.2.
  • Loading branch information
boydgreenfield committed Jul 19, 2014
1 parent b3725ae commit 330e993
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
nimcache/*
nimcache/*
murmur3
8 changes: 4 additions & 4 deletions murmur3.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{.compile: "murmur3_c.c".}

type
TMurmurHashes* = array[0..1, int64]
MurmurHashes* = array[0..1, int64]

proc raw_murmur_hash(key: cstring, len: int, seed: uint32, out_hashes: var TMurmurHashes): void {.
proc raw_murmur_hash(key: cstring, len: int, seed: uint32, out_hashes: var MurmurHashes): void {.
importc: "MurmurHash3_x64_128".}

proc murmur_hash*(key: string, seed: uint32 = 0'u32): TMurmurHashes =
proc murmur_hash*(key: string, seed: uint32 = 0'u32): MurmurHashes =
## Only implemented for strings at the moment. Returns an array of
## two 64-bit integers
var result: TMurmurHashes = [0'i64, 0'i64]
var result: MurmurHashes = [0'i64, 0'i64]
raw_murmur_hash(key = key, len = key.len, seed = seed, out_hashes = result)
return result

Expand Down

0 comments on commit 330e993

Please sign in to comment.