Documentation ¶
Overview ¶
Package scramble is a package that scramble integer numbers.
Index ¶
- func GenRandomSalt16() (uint16, uint16)
- func GenRandomSalt32() (uint32, uint32)
- func GenRandomSalt64() (uint64, uint64)
- func GenRandomSalt8() (uint8, uint8)
- func GenSaltInverse16(salt uint16) uint16
- func GenSaltInverse32(salt uint32) uint32
- func GenSaltInverse64(salt uint64) uint64
- func GenSaltInverse8(salt uint8) uint8
- type Scrambler16
- type Scrambler32
- type Scrambler64
- type Scrambler8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenRandomSalt16 ¶
GenRandomSalt16 randomly generates a salt and its inverse used by scrambler. The salt is a 16 bits unsigned integer.
func GenRandomSalt32 ¶
GenRandomSalt32 randomly generates a salt and its inverse used by scrambler. The salt is a 32 bits unsigned integer.
func GenRandomSalt64 ¶
GenRandomSalt64 randomly generates a salt and its inverse used by scrambler. The salt is a 64 bits unsigned integer.
func GenRandomSalt8 ¶
GenRandomSalt8 randomly generates a salt and its inverse used by scrambler. The salt and the inverse is a 8 bits unsigned integer.
func GenSaltInverse16 ¶
GenSaltInverse16 returns a inverse of the salt. The salt and the inverse is a 16 bits unsigned integer.
func GenSaltInverse32 ¶
GenSaltInverse32 returns a inverse of the salt. The salt and the inverse is a 32 bits unsigned integer.
func GenSaltInverse64 ¶
GenSaltInverse64 returns a inverse of the salt. The salt and the inverse is a 64 bits unsigned integer.
func GenSaltInverse8 ¶
GenSaltInverse8 returns a inverse of the salt. The salt and the inverse is a 8 bits unsigned integer.
Types ¶
type Scrambler16 ¶
type Scrambler16 struct {
// contains filtered or unexported fields
}
Scrambler16 scrambles 16 bit unsigned integers.
func NewScrambler16 ¶
func NewScrambler16() *Scrambler16
NewScrambler16 returns a new *Scramble16 with random salt and its inverse.
func NewScrambler16WithSalt ¶
func NewScrambler16WithSalt(salt uint16) *Scrambler16
NewScrambler16WithSalt returns a new *Scramble16 with the salt and its inverse.
func (*Scrambler16) Scramble ¶
func (s *Scrambler16) Scramble(v uint16) uint16
Scramble scrambles v.
type Scrambler32 ¶
type Scrambler32 struct {
// contains filtered or unexported fields
}
Scrambler32 scrambles 32 bit unsigned integers.
func NewScrambler32 ¶
func NewScrambler32() *Scrambler32
NewScrambler32 returns a new *Scramble32 with random salt and its inverse.
func NewScrambler32WithSalt ¶
func NewScrambler32WithSalt(salt uint32) *Scrambler32
NewScrambler32WithSalt returns a new *Scramble32 with the salt and its inverse.
func (*Scrambler32) Scramble ¶
func (s *Scrambler32) Scramble(v uint32) uint32
Scramble scrambles v.
type Scrambler64 ¶
type Scrambler64 struct {
// contains filtered or unexported fields
}
Scrambler64 scrambles 64 bit unsigned integers.
func NewScrambler64 ¶
func NewScrambler64() *Scrambler64
NewScrambler64 returns a new *Scramble64 with random salt and its inverse.
func NewScrambler64WithSalt ¶
func NewScrambler64WithSalt(salt uint64) *Scrambler64
NewScrambler64WithSalt returns a new *Scramble64 with the salt and its inverse.
func (*Scrambler64) Scramble ¶
func (s *Scrambler64) Scramble(v uint64) uint64
Scramble scrambles v.
type Scrambler8 ¶
type Scrambler8 struct {
// contains filtered or unexported fields
}
Scrambler8 scrambles 8 bit unsigned integers.
func NewScrambler8 ¶
func NewScrambler8() *Scrambler8
NewScrambler8 returns a new *Scramble8 with random salt and its inverse.
func NewScrambler8WithSalt ¶
func NewScrambler8WithSalt(salt uint8) *Scrambler8
NewScrambler8WithSalt returns a new *Scramble8 with the salt and its inverse.