Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Digester ¶
type Digester struct {
// contains filtered or unexported fields
}
Digester creates a null-delimited byte slice from a series of strings. It's an efficient way to create map keys.
This helps because (1) appending to a string allocates and (2) converting a byte slice to a string allocates, but (3) the Go compiler optimizes away byte-to-string conversions in map lookups. Using this type to build up a key and doing map lookups with myMap[string(d.digest())] is fast and zero-allocation.
func New ¶
func New() *Digester
New creates a new Digester. For optimal performance, be sure to call "Free" on each digester.
Click to show internal directories.
Click to hide internal directories.