Go Home Page
The Go Programming Language

Package hash

import "hash"

Package files

hash.go

type Hash

Hash is the common interface implemented by all hash functions.

type Hash interface {
    // Write adds more data to the running hash.
    // It never returns an error.
    io.Writer

    // Sum returns the current hash, without changing the
    // underlying hash state.
    Sum() []byte

    // Reset resets the hash to one with zero bytes written.
    Reset()

    // Size returns the number of bytes Sum will return.
    Size() int
}

type Hash32

Hash32 is the common interface implemented by all 32-bit hash functions.

type Hash32 interface {
    Hash
    Sum32() uint32
}

Subdirectories

Name   Synopsis
..
adler32 This package implements the Adler-32 checksum.
crc32 This package implements the 32-bit cyclic redundancy check, or CRC-32, checksum.