enum

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenByteStringBetween

func GenByteStringBetween(prev []byte, next []byte, spacing ByteSpacing) []byte

GenByteStringBetween generates a byte string that sorts between the two input strings. If prev is length 0, it is treated as negative infinity. If next is length 0, it is treated as positive infinity. Importantly, the input strings cannot end with minToken.

func GenerateNEvenlySpacedBytes

func GenerateNEvenlySpacedBytes(n int) [][]byte

GenerateNEvenlySpacedBytes returns an array of n byte slices that evenly split the key space into n pieces.

Types

type ByteSpacing

type ByteSpacing int

ByteSpacing is a type that controls what distribution of generated bytes strings is created with calls to GenByteStringBetween.

const (
	// PackedSpacing is used when the generated bytes are intended to be "close"
	// together in the generated key space.
	PackedSpacing ByteSpacing = iota
	// SpreadSpacing is used when the generated bytes are intended to be evenly
	// spaced out within the generated key space.
	SpreadSpacing
)

func (ByteSpacing) String

func (s ByteSpacing) String() string

Jump to

Keyboard shortcuts

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