common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HashLength = 32

HashLength is the length of Hash

Variables

This section is empty.

Functions

func Bytes2String

func Bytes2String(b []byte) (s string)

Bytes2String is transform []byte to string

func Hash2Bytes added in v0.1.0

func Hash2Bytes(h Hash) (b []byte)

Hash2Bytes is transform Hash to []byte

func Hash2String

func Hash2String(h Hash) (s string)

Hash2String is transform Hash to string

Types

type Hash

type Hash [HashLength]byte

Hash is fixed length []byte

func Bytes2Hash

func Bytes2Hash(b []byte) Hash

Bytes2Hash is transform []byte to Hash

func CreateHash added in v0.1.0

func CreateHash() Hash

CreateHash is used to create a random hash as wave id

func String2Hash added in v0.1.0

func String2Hash(s string) (Hash, error)

String2Hash is transform string to Hash

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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