Documentation ¶
Index ¶
- Variables
- func Abs(a int64) int64
- func Abs2(n int64) int64
- func CompareHashAndPassword(cipher, pwd []byte) error
- func GenerateFromPassword(pwd []byte) ([]byte, error)
- func GetGMTLocation() (*time.Location, error)
- func GetRootDir() (p string)
- func GetTimeInFormatISO8601() (timeStr string)
- func GetTimeInFormatRFC2616() (timeStr string)
- func Md5Hash(byt []byte) string
- func Md5Hex(byt []byte, salt []byte) string
- func Murmur128(byt []byte) (uint64, uint64)
- func Murmur32(byt []byte) uint32
- func Murmur64(byt []byte) uint64
- func RandString(n int) string
- func RandStringRunes(n int) string
- func RunTime(now, start int64) string
- func Scrypt(pwd []byte, salt []byte) ([]byte, error)
- func Sha1Hash(byt []byte) string
- func Sha256Hex(byt []byte, salt []byte) string
- func Sha512Hex(byt []byte, salt []byte) string
Constants ¶
This section is empty.
Variables ¶
View Source
var TZData []byte = nil
Functions ¶
func CompareHashAndPassword ¶
将密文与密码比较。error==nil 则相等。
func GetGMTLocation ¶
func GetTimeInFormatISO8601 ¶
func GetTimeInFormatISO8601() (timeStr string)
func GetTimeInFormatRFC2616 ¶
func GetTimeInFormatRFC2616() (timeStr string)
func Md5Hash ¶
BenchmarkMd5Hash-4 3500572 326 ns/op BenchmarkSha1Hash-4 2593280 423 ns/op BenchmarkMurmurHash32-4 80041621 14.6 ns/op BenchmarkMurmurHash64-4 37517820 35.3 ns/op murmurhash相比其它的算法有三倍以上的性能提升
func RandString ¶
func RandStringRunes ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.