README

seahash

Build Status GoDoc

A Go port of the SeaHash algorithm.

Benchmarks

Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz running Linux 5.3.0

BenchmarkSeahash64-8           	55457641	        20.8 ns/op	       0 B/op	       0 allocs/op

BenchmarkFnvHash32-8           	40879219	        30.2 ns/op	       4 B/op	       1 allocs/op
BenchmarkFnvHash64-8           	34940972	        30.6 ns/op	       8 B/op	       1 allocs/op

BenchmarkFarmHashHash32-8      	61766998	        19.3 ns/op	       0 B/op	       0 allocs/op
BenchmarkFarmHashHash64-8      	100000000	        11.6 ns/op	       0 B/op	       0 allocs/op

BenchmarkHuichenMurmur-8       	81137569	        13.6 ns/op	       0 B/op	       0 allocs/op
BenchmarkReuseeMurmur-8        	21982393	        52.7 ns/op	       4 B/op	       1 allocs/op
BenchmarkZhangMurmur-8         	91060291	        14.1 ns/op	       0 B/op	       0 allocs/op

BenchmarkDgryskiSpooky32-8     	44230748	        27.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkDgryskiSpooky64-8     	48947028	        23.9 ns/op	       0 B/op	       0 allocs/op

BenchmarkDgryskiStatdx64-8     	100000000	        11.5 ns/op	       0 B/op	       0 allocs/op

BenchmarkHashlandSpooky32-8   	40680852	        29.5 ns/op	       0 B/op	       0 allocs/op
BenchmarkHashlandSpooky64-8   	43915500	        28.0 ns/op	       0 B/op	       0 allocs/op

BenchmarkCreachadairCity32-8   	39462910	        28.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkCreachadairCity64-8   	80871393	        15.4 ns/op	       0 B/op	       0 allocs/op
Expand ▾ Collapse ▴

Documentation

Overview

    Package seahash implements SeaHash, a non-cryptographic hash function created by http://ticki.github.io.

    See https://ticki.github.io/blog/seahash-explained.

    Index

    Examples

    Constants

    View Source
    const BlockSize = 8

      BlockSize of SeaHash in bytes.

      View Source
      const Size = 8

        Size of a SeaHash checksum in bytes.

        Variables

        This section is empty.

        Functions

        func Sum

        func Sum(b []byte) []byte

          Sum is a convenience method that returns the checksum of the byte slice

          Example
          Output:
          
          75e54a6f823a991b
          

          func Sum64

          func Sum64(b []byte) uint64

            Sum64 is a convenience method that returns uint64 checksum of the byte slice

            Example
            Output:
            
            1b993a826f4ae575
            

            Types

            type Hasher

            type Hasher struct {
            	// contains filtered or unexported fields
            }

            func New

            func New() *Hasher

              New creates a new SeaHash hash.Hash64

              Example
              Output:
              
              1b993a826f4ae575
              

              func (*Hasher) BlockSize

              func (h *Hasher) BlockSize() int

                BlockSize returns BlockSize constant to satisfy hash.Hash interface

                func (*Hasher) Reset

                func (h *Hasher) Reset()

                func (*Hasher) Size

                func (h *Hasher) Size() int

                  Size returns Size constant to satisfy hash.Hash interface

                  func (*Hasher) Sum

                  func (d *Hasher) Sum(b []byte) []byte

                  func (*Hasher) Sum64

                  func (h *Hasher) Sum64() uint64

                  func (*Hasher) Write

                  func (h *Hasher) Write(b []byte) (nn int, err error)

                  Source Files