Documentation ¶
Overview ¶
Package tiger implements Tiger hash function and TTH (Tiger Tree Hash) algorithm.
Index ¶
- Constants
- func New() hash.Hash
- type Hash
- func (h Hash) Base32() string
- func (h Hash) Bytes() []byte
- func (h *Hash) FromBase32(s string) error
- func (h Hash) Hex() string
- func (h Hash) IsZero() bool
- func (h Hash) MarshalADC(buf *bytes.Buffer) error
- func (h Hash) MarshalBase32(buf []byte) error
- func (h Hash) MarshalText() ([]byte, error)
- func (h Hash) String() string
- func (h *Hash) UnmarshalADC(buf []byte) error
- func (h *Hash) UnmarshalBase32(buf []byte) error
- func (h *Hash) UnmarshalText(text []byte) error
- type Leaves
Constants ¶
const ( BlockSize = 64 // 512 bits Size = 24 // 192 bits Base32Size = 39 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hash ¶
Hash is a tiger hash value.
func MustParseBase32 ¶
MustParseBase32 parses the tiger hash from base32 encoding and panics on error.
func (*Hash) FromBase32 ¶
FromBase32 parses hash from base32 encoding.
func (Hash) MarshalADC ¶ added in v0.9.0
MarshalADC implements adc.Marshaler.
func (Hash) MarshalBase32 ¶ added in v0.6.2
MarshalBase32 encodes the hash to a given buffer. Buffer should be at least Base32Len.
func (Hash) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Hash) UnmarshalADC ¶ added in v0.9.0
UnmarshalADC implements adc.Unmarshaler.
func (*Hash) UnmarshalBase32 ¶ added in v0.6.2
UnmarshalBase32 decodes the hash from a given buffer.
func (*Hash) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Leaves ¶ added in v0.3.2
type Leaves []Hash
Leaves are a sequence of concatenated hashes that can be used to validate the single parts of a certain file.
func TreeLeaves ¶ added in v0.3.2
TreeLeaves computes the TTH leaves of a reader.