hash

package
v0.192.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 12 Imported by: 0

README

Hash Package

The Flux Hash Package provides functions that perform hash conversion of string values.

hash.sha256

The hash.sha256() function converts a single string to a hash using sha256.

Example:

    import "contrib/qxip/hash"

    a = hash.sha256("Hello, world!")
    // a is "315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3"

hash.xxhash64

The hash.xxhash64() function converts a single string to a hash using xxhash64.

Example:

    import "contrib/qxip/hash"

    a = hash.xxhash64("Hello, world!")
    // a is "17691043854468224118"

hash.cityhash64

The hash.cityhash64() function converts a single string to hash using cityhash64.

Example:

    import "contrib/qxip/hash"

    a = hash.cityhash64("Hello, world!")
    // a is "2359500134450972198"

Contact

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CityHash64

func CityHash64(s []byte, length uint32) uint64

func CityHash64WithSeed

func CityHash64WithSeed(s []byte, length uint32, seed uint64) uint64

func CityHash64WithSeeds

func CityHash64WithSeeds(s []byte, length uint32, seed0, seed1 uint64) uint64

func Hash128to64

func Hash128to64(x Uint128) uint64

Types

type Uint128

type Uint128 [2]uint64

func CityHash128

func CityHash128(s []byte, length uint32) (result Uint128)

func CityHash128WithSeed

func CityHash128WithSeed(s []byte, length uint32, seed Uint128) Uint128

func (Uint128) Bytes

func (t Uint128) Bytes() []byte

func (Uint128) Higher64

func (t Uint128) Higher64() uint64

func (Uint128) Lower64

func (t Uint128) Lower64() uint64

Jump to

Keyboard shortcuts

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