Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSNumber ¶
func JSNumber[T constraints.Integer | constraints.Float](num T) T
JSNumber 转换成兼容JS的数值.
func SipHash64 ¶
SipHash64 哈希,和Google Guava的sipHash24相同.
Example ¶
package main
import (
"fmt"
"github.com/xuender/kit/hashs"
)
func main() {
fmt.Println(hashs.SipHash64([]byte("123")))
}
Output: 9379172312344772015
func SipHash128 ¶
SipHash128 哈希.
Example ¶
package main
import (
"fmt"
"github.com/xuender/kit/hashs"
)
func main() {
fmt.Println(hashs.SipHash128([]byte("123")))
}
Output: 8693645449139915215 11618447955228391416
func SipHashHex ¶
SipHashHex 字符串.
Example ¶
package main
import (
"fmt"
"github.com/xuender/kit/hashs"
)
func main() {
fmt.Println(hashs.SipHashHex([]byte("123")))
}
Output: 822983866c7d3daf
func SipHashNumber ¶
SipHashNumber 兼容JS, 53位长度.
Example ¶
package main
import (
"fmt"
"github.com/xuender/kit/hashs"
)
func main() {
fmt.Println(hashs.SipHashNumber([]byte("123")))
}
Output: 2677888159399343
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.