hashutil

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2018 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package hashutil provides alloc free alternatives for pkg/hash

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashStringFnv64a

func HashStringFnv64a(str string) uint64

Types

type InlineFNV64a

type InlineFNV64a uint64

InlineFNV64a is a alloc-free version of https://golang.org/pkg/hash/fnv/ copied from Xephon-K, which is copied from influxdb/models https://github.com/influxdata/influxdb/blob/master/models/inline_fnv.go

func NewInlineFNV64a

func NewInlineFNV64a() InlineFNV64a

NewInlineFNV64a returns a new instance of InlineFNV64a.

func (*InlineFNV64a) Sum64

func (s *InlineFNV64a) Sum64() uint64

Sum64 returns the uint64 of the current resulting hash.

func (*InlineFNV64a) Write

func (s *InlineFNV64a) Write(data []byte) (int, error)

Write adds data to the running hash.

func (*InlineFNV64a) WriteString

func (s *InlineFNV64a) WriteString(str string) (int, error)

WriteString avoids a []byte(str) conversion BUT yield different result when string contains non ASCII characters

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL