Skip to content

Commit

Permalink
修复
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed Apr 2, 2024
1 parent fafaac3 commit a5428b9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hash/siphash.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ func (this Hash) NewSiphash128(k []byte) Hash {

// SiphashWithCDroundsAndHashSize
func (this Hash) SiphashWithCDroundsAndHashSize(k []byte, crounds, drounds int32, hashSize int) Hash {
h := siphash.NewWithCDroundsAndHashSize(k, crounds, drounds, hashSize)
h.Write(this.data)
h, err := siphash.NewWithCDroundsAndHashSize(k, crounds, drounds, hashSize)
if err != nil {
this.Error = err
return this
}

h.Write(this.data)
this.data = h.Sum(nil)

return this
}

// NewSiphashWithCDroundsAndHashSize
func (this Hash) NewSiphashWithCDroundsAndHashSize(k []byte, crounds, drounds int32, hashSize int) Hash {
this.hash = siphash.NewWithCDroundsAndHashSize(k, crounds, drounds, hashSize)
this.hash, this.Error = siphash.NewWithCDroundsAndHashSize(k, crounds, drounds, hashSize)

return this
}

0 comments on commit a5428b9

Please sign in to comment.