nibbles

package
v4.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2020 License: AGPL-3.0, AGPL-3.0-or-later Imports: 2 Imported by: 0

Documentation

Overview

Package nibbles is a library for representing sequences of 4-bit values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Nibbles

type Nibbles struct {
	// contains filtered or unexported fields
}

Nibbles is a slice-like data structure for storing sequences of 4-bit values.

func Make

func Make(n int) Nibbles

Make creates nibbles of the given length.

func Make2

func Make2(n, m int) Nibbles

Make2 creates nibbles of the given length and capacity.

func ReflectMake

func ReflectMake(len, offset int, bytes []byte) Nibbles

ReflectMake creates nibbles of the given length, offset, and raw byte slice.

func (Nibbles) Append

func (n Nibbles) Append(value byte) Nibbles

Append appends the given nibble.

func (Nibbles) AppendSlice

func (n Nibbles) AppendSlice(m Nibbles) Nibbles

AppendSlice appends the given nibbles.

func (Nibbles) Cap

func (n Nibbles) Cap() int

Cap returns the capacity of these nibbles.

func (Nibbles) Copy

func (n Nibbles) Copy(m Nibbles) int

Copy copies the given nibbles.

func (Nibbles) Get

func (n Nibbles) Get(index int) byte

Get returns the nibble at the given index.

func (Nibbles) Len

func (n Nibbles) Len() int

Len returns the number of 4-bit values stored in these nibbles.

func (Nibbles) ReflectValue

func (n Nibbles) ReflectValue() (len, offset int, bytes []byte)

ReflectValue returns the underlying representation of the nibbles.

func (Nibbles) Set

func (n Nibbles) Set(index int, value byte)

Set sets the nibble at the given index.

func (Nibbles) Slice

func (n Nibbles) Slice(low, high int) Nibbles

Slice returns a subsequence of the given nibbles.

func (Nibbles) Slice3

func (n Nibbles) Slice3(low, high, max int) Nibbles

Slice3 returns a subsequence of the given nibbles, also adapting the capacity.

func (Nibbles) String

func (n Nibbles) String() string

String returns a string representation of the given nibbles.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL