Documentation ¶
Index ¶
- func Fnv32a(s []byte) uint32
- func Fnv32aExt(s []byte) uint64
- func FnvCodeFromStr(s string) uint32
- func FnvCodeFromUint64(v uint64) uint32
- func HashCode(s []byte) uint32
- func HostIP() (net.IP, error)
- func HostnameHashCode() uint32
- func IpHashCode() uint32
- func New() uint64
- func NewGId() *gid
- func NewRand(seed int64) *rand.Rand
- func RandomFromStr(s string) uint32
- func RandomFromUint64(v uint64) uint32
- func SplitId(s string) (low string, high string)
- func StrToUint64(s string) uint64
- func UUID() string
- func UnixFromStr(s string) int64
- func UnixFromUint64(v uint64) int64
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FnvCodeFromStr ¶
func FnvCodeFromUint64 ¶
func HostnameHashCode ¶
func HostnameHashCode() uint32
func IpHashCode ¶
func IpHashCode() uint32
func RandomFromStr ¶
func RandomFromUint64 ¶
func StrToUint64 ¶
func UnixFromStr ¶
Example ¶
s := "a376611a0fc5a696bbfefc84" low, high := SplitId(s) fmt.Println(low, high) fmt.Println(UnixFromStr(low)) fmt.Println(time.Unix(UnixFromStr(low), 0)) fmt.Println(FnvCodeFromStr(low)) fmt.Println(RandomFromStr(low))
Output:
func UnixFromUint64 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.