Skip to content

Commit

Permalink
Change visibility of helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
korthaj committed May 18, 2017
1 parent 82903bb commit 4b348f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type digest struct {
h2 uint64
}

func Uint64(b []byte) uint64 {
func uint64byte(b []byte) uint64 {
return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
}
Expand All @@ -32,8 +32,8 @@ func (d *digest) bmix(p []byte) (tail []byte) {
nblocks := len(p) / 16
for i := 0; i < nblocks; i++ {
j := 16 * i
k1 := Uint64(p[j : j+8])
k2 := Uint64(p[j+8 : j+16])
k1 := uint64byte(p[j : j+8])
k2 := uint64byte(p[j+8 : j+16])
k1 *= c1
k1 = (k1 << 31) | (k1 >> 33)
k1 *= c2
Expand Down
6 changes: 3 additions & 3 deletions hash_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type digestString struct {
h2 uint64
}

func Uint64String(b string) uint64 {
func uint64String(b string) uint64 {
return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
}
Expand All @@ -27,8 +27,8 @@ func (d *digestString) bmixString(p string) (tail string) {
nblocks := len(p) / 16
for i := 0; i < nblocks; i++ {
j := 16 * i
k1 := Uint64String(p[j : j+8])
k2 := Uint64String(p[j+8 : j+16])
k1 := uint64String(p[j : j+8])
k2 := uint64String(p[j+8 : j+16])
k1 *= c1
k1 = (k1 << 31) | (k1 >> 33)
k1 *= c2
Expand Down

0 comments on commit 4b348f2

Please sign in to comment.