util

package
v0.0.0-...-3b9bdc6 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Uppercase        = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	Lowercase        = "abcdefghijklmnopqrstuvwxyz"
	Numeric          = "0123456789"
	UppercaseNumeric = fmt.Sprintf("%s%s", Uppercase, Numeric)
	Alpha            = fmt.Sprintf("%s%s", Uppercase, Lowercase)
	AlphaNumeric     = fmt.Sprintf("%s%s", Alpha, Numeric)
)

Functions

func GenerateRandomHEX

func GenerateRandomHEX(size int) string

GenerateRandomHEX returns random hex number in string format by the given size (in bytes).

func GenerateSecret

func GenerateSecret(plain, salt string, len int) string

GenerateSecret returns hashed string from combination of plain and salt. It presented in base64 format. The used algorithm is sha512.

func GenerateTimestampWithPrefix

func GenerateTimestampWithPrefix(prefix string) string

func GenerateUniqueID

func GenerateUniqueID(composition string, length int) (id string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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