adding constructors
This commit is contained in:
parent
ce83baa68c
commit
45b33e8013
@ -2,6 +2,7 @@ package mishmash
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hash"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -96,6 +97,10 @@ type Mishmash32 struct {
|
||||
accumulator uint64
|
||||
}
|
||||
|
||||
func New32() hash.Hash32 {
|
||||
return &Mishmash32{}
|
||||
}
|
||||
|
||||
// Sum appends the current hash to b and returns the resulting slice.
|
||||
// It does not change the underlying hash state.
|
||||
func (m *Mishmash32) Sum(p []byte) []byte {
|
||||
@ -134,6 +139,10 @@ type Mishmash64 struct {
|
||||
accumulator uint64
|
||||
}
|
||||
|
||||
func New64() hash.Hash64 {
|
||||
return &Mishmash64{}
|
||||
}
|
||||
|
||||
// Sum appends the current hash to b and returns the resulting slice.
|
||||
// It does not change the underlying hash state.
|
||||
func (m *Mishmash64) Sum(p []byte) []byte {
|
||||
|
Loading…
x
Reference in New Issue
Block a user