Documentation ¶
Index ¶
- type Uint128
- func (u Uint128) Add(v Uint128) Uint128
- func (u Uint128) And(o Uint128) Uint128
- func (u Uint128) Cmp(v Uint128) int
- func (u Uint128) Cmp64(v uint64) int
- func (u Uint128) Compare(o Uint128) int
- func (u Uint128) Equal(o Uint128) bool
- func (u Uint128) Equals64(v uint64) bool
- func (u Uint128) GetBytes() []byte
- func (u Uint128) HexString() string
- func (u Uint128) IsZero() bool
- func (u Uint128) Or(o Uint128) Uint128
- func (u Uint128) QuoRem64(v uint64) (q Uint128, r uint64)
- func (u Uint128) String() string
- func (u Uint128) Sub(v Uint128) Uint128
- func (u Uint128) Xor(o Uint128) Uint128
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Uint128 ¶
type Uint128 struct {
Hi, Lo uint64
}
Uint128 is a big-endian 128 bit unsigned integer which wraps two uint64s.
var Zero Uint128
func FromBytes ¶
FromBytes parses the byte slice as a 128 bit big-endian unsigned integer. The caller is responsible for ensuring the byte slice contains 16 bytes.
func FromString ¶
FromString parses a hexadecimal string as a 128-bit big-endian unsigned integer.
func (Uint128) Cmp ¶ added in v0.0.20
Cmp compares u and v and returns:
-1 if u < v 0 if u == v +1 if u > v
func (Uint128) Cmp64 ¶ added in v0.0.20
Cmp64 compares u and v and returns:
-1 if u < v 0 if u == v +1 if u > v
Click to show internal directories.
Click to hide internal directories.