Documentation
¶
Overview ¶
package hash uniform the interface to create a hash objet
Index ¶
- func New(t HashMethod) hash.Hash
- func NewNoneHash() hash.Hash
- type Fingerprint
- func (this *Fingerprint) BlockSize() int
- func (this *Fingerprint) Hash() hash.Hash
- func (this *Fingerprint) Reset()
- func (this *Fingerprint) Resetsize(size int64)
- func (this *Fingerprint) Size() int
- func (this *Fingerprint) String() string
- func (this *Fingerprint) Sum(b []byte) []byte
- func (this *Fingerprint) Write(p []byte) (n int, err error)
- type HashMethod
- type NoneHash
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNoneHash ¶
Types ¶
type Fingerprint ¶
type Fingerprint struct {
// contains filtered or unexported fields
}
finger print hash algorithm, use md5+sha1+crc64
func NewFingerprint ¶
func NewFingerprint() *Fingerprint
func (*Fingerprint) BlockSize ¶
func (this *Fingerprint) BlockSize() int
func (*Fingerprint) Hash ¶
func (this *Fingerprint) Hash() hash.Hash
func (*Fingerprint) Reset ¶
func (this *Fingerprint) Reset()
func (*Fingerprint) Resetsize ¶
func (this *Fingerprint) Resetsize(size int64)
func (*Fingerprint) Size ¶
func (this *Fingerprint) Size() int
func (*Fingerprint) String ¶
func (this *Fingerprint) String() string
func (*Fingerprint) Sum ¶
func (this *Fingerprint) Sum(b []byte) []byte
type HashMethod ¶
type HashMethod uint
const ( NONE HashMethod = iota MD5 SHA1 SHA256 SHA512 CRC32 CRC64 FINGERPRINT //finger print, use md5+sha1+crc64 )
func (HashMethod) StringHashL ¶
func (me HashMethod) StringHashL(s string) (h string)
string hash with length
Click to show internal directories.
Click to hide internal directories.