Help us shape the future of Go! Take the 2026 Go Developer Survey

stringhelper

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareLabels

func CompareLabels(search map[string]string, labels map[string]string) bool

CompareLabels compares two maps of labels

func DoHashsMatchWithString

func DoHashsMatchWithString(hash, text string, salt []byte) bool

Check if two passwords match

func GetMD5Hash

func GetMD5Hash(data []byte) string

GetMD5Hash returns the md5 hash of a byte array

func HashSHA512

func HashSHA512(text string, salt []byte) string

Hash a password with the SHA-512 algorithm

func JsonToMap

func JsonToMap(jsonStr string) (map[string]interface{}, error)

JsonToMap converts a json string to a map

func PrettyprintStruct

func PrettyprintStruct(obj interface{})

PrettyprintStruct prints a struct in a pretty way

func RandomString

func RandomString(strSize int, randType StringType) string

RandomString returns a random string of the specified length

Types

type StringType

type StringType = string
const (
	StringTypeUnknown   StringType = "Unknown"
	StringTypeAlphaNum  StringType = "alphanum"
	StringTypeClusterId StringType = "clusterid"
	StringTypeAlpha     StringType = "alpha"
	StringTypeNumber    StringType = "number"
)

Jump to

Keyboard shortcuts

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