hashutil

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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