compositehash

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(text string, atime time.Time) (int64, error)

New generates a composite hash for the given text and time.

The function computes a hash value of the text using the FNV-1a hash function, which is fast and provides good enough distribution for our purposes. The hash value is then combined with the time, expressed in milliseconds since the epoch, to generate a unique identifier. The resulting identifier is guaranteed to be unique and sortable for the given text and time.

Parameters:

  • text: the text to generate a composite hash for.
  • atime: the time to use in generating the composite hash.

Returns:

  • int64: the composite hash for the given text and time.
  • error: if there was an error computing the hash value of the text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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