blockdigest

package
v0.0.0-...-288f078 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0, Apache-2.0, CC-BY-SA-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package blockdigest stores a Block Locator Digest compactly. Can be used as a map key.

Index

Constants

This section is empty.

Variables

View Source
var LocatorPattern = regexp.MustCompile(
	"^[0-9a-fA-F]{32}\\+[0-9]+(\\+[A-Z][A-Za-z0-9@_-]*)*$")

Functions

func IsBlockLocator

func IsBlockLocator(s string) bool

Types

type BlockDigest

type BlockDigest struct {
	H uint64
	L uint64
}

BlockDigest stores a Block Locator Digest compactly, up to 128 bits. Can be used as a map key.

func FromString

func FromString(s string) (dig BlockDigest, err error)

FromString creates a new BlockDigest unless an error is encountered.

func MakeTestBlockDigest

func MakeTestBlockDigest(i int) BlockDigest

MakeTestBlockDigest is used for testing with distinct BlockDigests

func (BlockDigest) String

func (d BlockDigest) String() string

type BlockLocator

type BlockLocator struct {
	Digest BlockDigest
	Size   int
	Hints  []string
}

func ParseBlockLocator

func ParseBlockLocator(s string) (b BlockLocator, err error)

type DigestWithSize

type DigestWithSize struct {
	Digest BlockDigest
	Size   uint32
}

func MakeTestDigestSpecifySize

func MakeTestDigestSpecifySize(i int, s int) DigestWithSize

func MakeTestDigestWithSize

func MakeTestDigestWithSize(i int) DigestWithSize

func (DigestWithSize) String

func (w DigestWithSize) String() string

Jump to

Keyboard shortcuts

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