cockroach: github.com/cockroachdb/cockroach/pkg/util/uint128 Index | Files

package uint128

import "github.com/cockroachdb/cockroach/pkg/util/uint128"

Index

Package Files

uint128.go

type Uint128 Uses

type Uint128 struct {
    Hi, Lo uint64
}

Uint128 is a big-endian 128 bit unsigned integer which wraps two uint64s.

func FromBytes Uses

func FromBytes(b []byte) Uint128

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 FromInts Uses

func FromInts(hi uint64, lo uint64) Uint128

FromInts takes in two unsigned 64-bit integers and constructs a Uint128.

func FromString Uses

func FromString(s string) (Uint128, error)

FromString parses a hexadecimal string as a 128-bit big-endian unsigned integer.

func (Uint128) Add Uses

func (u Uint128) Add(n uint64) Uint128

Add returns a new Uint128 incremented by n.

func (Uint128) And Uses

func (u Uint128) And(o Uint128) Uint128

And returns a new Uint128 that is the bitwise AND of two Uint128 values.

func (Uint128) Compare Uses

func (u Uint128) Compare(o Uint128) int

Compare compares the two Uint128.

func (Uint128) Equal Uses

func (u Uint128) Equal(o Uint128) bool

Equal returns whether or not the Uint128 are equivalent.

func (Uint128) GetBytes Uses

func (u Uint128) GetBytes() []byte

GetBytes returns a big-endian byte representation.

func (Uint128) Or Uses

func (u Uint128) Or(o Uint128) Uint128

Or returns a new Uint128 that is the bitwise OR of two Uint128 values.

func (Uint128) String Uses

func (u Uint128) String() string

String returns a hexadecimal string representation.

func (Uint128) Sub Uses

func (u Uint128) Sub(n uint64) Uint128

Sub returns a new Uint128 decremented by n.

func (Uint128) Xor Uses

func (u Uint128) Xor(o Uint128) Uint128

Xor returns a new Uint128 that is the bitwise XOR of two Uint128 values.

Package uint128 imports 3 packages (graph) and is imported by 13 packages. Updated 2019-07-04. Refresh now. Tools for package owners.