diff --git a/mishmash.go b/mishmash.go index b12ca01..f64560d 100644 --- a/mishmash.go +++ b/mishmash.go @@ -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 {