Documentation ¶
Index ¶
- Constants
- func AppendArg(b []byte, v interface{}) []byte
- func Bytes(s string) []byte
- func CodeToIDBase34(idByte []byte) (uint64, error)
- func CodeToIDReverse(code string) (int64, error)
- func Contains(target interface{}, obj interface{}) bool
- func ContainsString(slice []string, item string) bool
- func GenCodeBase34(id uint64) []byte
- func GenCodeReverse(id int64) string
- func GenerateNonce() (string, error)
- func GenerateNonceLength(Length int) (string, error)
- func IntToStringArray(arr []int) []string
- func Join(elems []string, sep string) string
- func Len(str string) int
- func LowercaseFirst(str string) string
- func NewLine() string
- func PadLeft(s string, pad string, plength int) string
- func RandomString(length int) string
- func RemoveRepeatSlice(slc []string) []string
- func RemoveRepeatSliceInt(slc []int) []int
- func Reverse(x int64) int64
- func String(b []byte) string
- func StringToIntArray(arr []string) []int
- func Sub(str string, start int, length int) string
- func SubString(str string, begin, length int) string
- func UppercaseFirst(str string) string
Constants ¶
View Source
const ( // NonceSymbols 随机字符串可用字符集 NonceSymbols = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // NonceLength 随机字符串的长度 NonceLength = 32 )
Variables ¶
This section is empty.
Functions ¶
func CodeToIDBase34 ¶
CodeToIDBase34 -- 将code逆向转换成原始id
func CodeToIDReverse ¶ added in v0.4.0
CodeToIDReverse -- 将code逆向转换成原始id
func GenCodeReverse ¶ added in v0.4.0
GenCodeReverse 将id转换成n位长度的code
func GenerateNonce ¶ added in v0.4.7
GenerateNonce 生成一个长度为 NonceLength 的随机字符串(只包含大小写字母与数字)
func GenerateNonceLength ¶ added in v0.4.7
GenerateNonceLength 生成一个长度为 Length 的随机字符串(只包含大小写字母与数字)
func IntToStringArray ¶ added in v0.4.7
func Join ¶
Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.
func RemoveRepeatSlice ¶ added in v0.4.7
RemoveRepeatSlice 元素去重
func RemoveRepeatSliceInt ¶ added in v0.4.7
RemoveRepeatSliceInt 元素去重
func StringToIntArray ¶ added in v0.4.7
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.