utils

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

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

Go to latest
Published: Nov 27, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractStringsFromMap

func ExtractStringsFromMap(m map[string]any, trim bool) map[string]string

ExtractStringsFromMap returns a new map with all the string values from m. If trim is true, the string values of the returned map are space trimmed.

func GenerateSenetence

func GenerateSenetence(wc int) string

func GenerateStringID

func GenerateStringID(length int) string

GenerateStringID returns a random string containing only the following letters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_

func GenerateText

func GenerateText() string

func NewHMAC

func NewHMAC(message, key string) string

func TruncateUnicodeString

func TruncateUnicodeString(s string, length int) string

TruncateUnicodeString truncates s to a max length of length. It also guarantees that the returned string is of valid utf-8.

func ValidMAC

func ValidMAC(message, messageMAC64, key string) (bool, error)

ValidMAC reports whether messageMAC64 (base64) is a valid HMAC tag for message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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