Documentation
¶
Index ¶
- Constants
- func ABTest(data, salt []byte, groups ...uint64) uint64
- func Between(data string, keys ...string) string
- func ByteSliceToString(b []byte) string
- func CRC16(field string) uint16
- func CRC32(field string) uint32
- func CommonString(str string) string
- func EmailDomain(email string) string
- func EmailUserName(email string) string
- func GetShortID() ([]byte, error)
- func GetTinyID() ([]byte, error)
- func GetUniqueID() string
- func HashName(name string) string
- func MaskField(str string, keepUnmaskedFront int, keepUnmaskedEnd int) string
- func NFDLowerString(str string) string
- func NFKDLowerString(str string) string
- func RandStringBytes(n int) string
- func SafeGet[T any](ptr *T, defaultValue T) T
- func SanitizeEmail(email string) string
- func SimHash(data []byte) uint64
- func SimHashCompare(val1, val2 uint64) uint8
- func SplitBetweenTokens(data string, keys ...string) []string
- func SplitByChunks(s string, chunkSize int) []string
- type ContextKey
- type Password
- type Str
Constants ¶
View Source
const ( EmailTagStart = "+" EmailAt = "@" )
Variables ¶
This section is empty.
Functions ¶
func ByteSliceToString ¶
ByteSliceToString cast given bytes to strings, without allocation memory
func CommonString ¶
func EmailDomain ¶
func EmailUserName ¶
func NFDLowerString ¶
func NFKDLowerString ¶
func RandStringBytes ¶
func SafeGet ¶
func SafeGet[T any](ptr *T, defaultValue T) T
SafeGet return value of pointer, and return default value if it nil
func SanitizeEmail ¶
func SimHashCompare ¶
func SplitBetweenTokens ¶
SplitBetweenTokens takes strings and one or two tokens, and cuts everything between two tokens, or between two copies of first token.
func SplitByChunks ¶
Types ¶
type Password ¶
type Password string
Password describe masked field
func (Password) MarshalJSON ¶
MarshalJSON block to show value in json
Click to show internal directories.
Click to hide internal directories.