Documentation ¶
Index ¶
- Constants
- func BuildBytesFromInt64(value int64) []byte
- func BuildBytesFromUint64(value uint64) []byte
- func BuildInt64FromBytes(data []byte) (res int64)
- func BuildUint64FromBytes(data []byte) (res uint64)
- func GetHashFunctionNameBySize(size int) (string, int, error)
- type Generator
- type Hash
- type HashReducer
- type HybridBytes
- type Int64Random
- type MurmurHash
- type Projector
- type RandomBytes
- type SipHash
Constants ¶
View Source
const ( Sha1Name = "sha1" Sha256Name = "sha256" Sha512Name = "sha512" Sha3224 = "sha3-224" Sha3256 = "sha3-256" Sha3384 = "sha3-384" Sha3512 = "sha3-512" )
View Source
const ( MurMurHash32Size = 4 MurMurHash64Size = 8 MurMurHash128Size = 16 )
Variables ¶
This section is empty.
Functions ¶
func BuildBytesFromInt64 ¶
func BuildBytesFromUint64 ¶
func BuildInt64FromBytes ¶
BuildInt64FromBytes - decode bytes array to int64 representation. In case there is less
func BuildUint64FromBytes ¶
Types ¶
type Generator ¶
We don't know the byte length in the output, min value, max value
func NewHashReducer ¶
func NewSipHash ¶
type HashReducer ¶
type HashReducer struct {
// contains filtered or unexported fields
}
func (*HashReducer) Size ¶
func (hr *HashReducer) Size() int
type HybridBytes ¶
type HybridBytes struct {
// contains filtered or unexported fields
}
func NewHybridBytes ¶
func NewHybridBytes(seed int64, requestedSize int, h Generator) *HybridBytes
type Int64Random ¶
type Int64Random struct {
// contains filtered or unexported fields
}
func NewInt64Random ¶
func NewInt64Random(seed int64) (*Int64Random, error)
func (*Int64Random) Size ¶
func (i *Int64Random) Size() int
type MurmurHash ¶
func NewMurmurHash ¶
func NewMurmurHash(seed uint32, size int) *MurmurHash
func (*MurmurHash) Size ¶
func (mh *MurmurHash) Size() int
type Projector ¶
type Projector struct {
// contains filtered or unexported fields
}
func NewProjector ¶
type RandomBytes ¶
type RandomBytes struct {
// contains filtered or unexported fields
}
func NewRandomBytes ¶
func NewRandomBytes(seed int64, size int) *RandomBytes
func (*RandomBytes) Size ¶
func (br *RandomBytes) Size() int
Source Files ¶
Click to show internal directories.
Click to hide internal directories.