Documentation ¶
Index ¶
- Variables
- func Bytes(s string) []byte
- func Filter[T any](collection []T, callback func(item T) bool) []T
- func FilterMap[T any, R any](collection []T, callback func(item T) (R, bool)) []R
- func Map[T any, R any](collection []T, iteratee func(item T) R) []R
- func Must[T any](value T, err error) T
- func NewChaCha8() *rand.ChaCha8
- func Ptr[T any](v T) *T
- func RandomString(length int) string
- func RandomStringWithAlphabet(length int, alphabet string) string
- func Regexp(expr string) (*regexp2.Regexp, bool)
- func RegexpPath(path string) (*regexp2.Regexp, error)
- func String(b []byte) string
- func ToInt64(s string) int64
- func Unique[S ~[]E, E comparable](s S) S
Constants ¶
This section is empty.
Variables ¶
View Source
var ReNoPath = regexp2.MustCompile(reNoPathExpr, reOptions)
Functions ¶
func Bytes ¶
Bytes converts string to byte slice without a memory allocation. For more details, see https://github.com/golang/go/issues/53003#issuecomment-1140276077.
func NewChaCha8 ¶
func NewChaCha8() *rand.ChaCha8
func RandomString ¶
RandomString generates a cryptographically random string with the specified length.
The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.
func RandomStringWithAlphabet ¶
RandomStringWithAlphabet generates a cryptographically random string with the specified length and characters set.
func String ¶
String converts byte slice to string without a memory allocation. For more details, see https://github.com/golang/go/issues/53003#issuecomment-1140276077.
func Unique ¶
func Unique[S ~[]E, E comparable](s S) S
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.