Documentation ¶
Index ¶
- Variables
- func B2s(b []byte) string
- func BoolFromStr(s string, def bool) bool
- func HmacHex(data, key []byte) string
- func Md5Hex(str string) string
- func Md5HexShort(str string) string
- func NextNumberPowerOf2(v uint64) uint64
- func RandomText(n int) string
- func S2b(s string) []byte
- func StrInSlice(a string, list []string) bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TrueStrings = []string{"1", "t", "true", "on", "y", "yes"} FalseStrings = []string{"0", "f", "false", "off", "n", "no"} )
Functions ¶
func B2s ¶
B2s converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
Note it may break if string and/or slice header will change in the future go versions.
func BoolFromStr ¶
func NextNumberPowerOf2 ¶
*
- NextNumberPowerOf2
- returns the next nearest power of 2 for the given integer number
- param: uint64 v
- return: uint64
func RandomText ¶
func S2b ¶
S2b converts string to a byte slice without memory allocation.
Note it may break if string and/or slice header will change in the future go versions.
func StrInSlice ¶
StrInSlice returns a bool if the value in the slice Deprecated: Use sliceutil.In replace it
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.