deephash

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: BSD-3-Clause Imports: 12 Imported by: 11

Documentation

Overview

Package deephash hashes a Go value recursively, in a predictable order, without looping. The hash is only valid within the lifetime of a program. Users should not store the hash on disk or send it over the network. The hash is sufficiently strong and unique such that Hash(x) == Hash(y) is an appropriate replacement for x == y.

This package, like most of the tailscale.com Go module, should be considered Tailscale-internal; we make no API promises.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Update

func Update(last *Sum, v ...interface{}) (changed bool)

Update sets last to the hash of v and reports whether its value changed.

Types

type Sum

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

Sum is an opaque checksum type that is comparable.

func Hash

func Hash(v interface{}) Sum

Hash returns the hash of v.

func (Sum) String

func (s Sum) String() string

Jump to

Keyboard shortcuts

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