hash

package
v0.194.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 16 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(v: "Hello, world!")

hash.sha1

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

Example:

    import "contrib/qxip/hash"

    a = hash.sha1(v: "Hello, world!")

hash.xxhash64

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

Example:

    import "contrib/qxip/hash"

    a = hash.xxhash64(v: "Hello, world!")

hash.cityhash64

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

Example:

    import "contrib/qxip/hash"

    a = hash.cityhash64(v: "Hello, world!")

hash.md5

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

Example:

    import "contrib/qxip/hash"

    a = hash.md5(v: "Hello, world!")

hash.b64

The hash.b64() function converts a single string to a Base64 string.

Example:

    import "contrib/qxip/hash"

    a = hash.b64(v: "Hello, world!")

hash.hmac

The hash.hmac() function converts a string and key pair to sha1 signed Base64 string.

Example:

    import "contrib/qxip/hash"

    a = hash.hmac(v: "helloworld", k: "123456")

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