tools

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SessionPrefix = "sess_"

Variables

This section is empty.

Functions

func CityHash32

func CityHash32(s []byte, length uint32) uint32

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 CreateSessionId

func CreateSessionId(sessionId string) string

func GetNowDateTime

func GetNowDateTime() string

func GetRandomToken

func GetRandomToken(length int) string

func GetSessionIdByUserId

func GetSessionIdByUserId(userId int) string

func GetSessionName

func GetSessionName(sessionId string) string

func GetSnowflakeId

func GetSnowflakeId() string

func IsLittleEndian

func IsLittleEndian() bool

func Sha1

func Sha1(s string) (str string)

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 (this Uint128) Bytes() []byte

func (Uint128) Higher64

func (this Uint128) Higher64() uint64

func (Uint128) Lower64

func (this Uint128) Lower64() uint64

Jump to

Keyboard shortcuts

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