utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteXor

func ByteXor(a, b []byte) ([]byte, error)

ByteXor Compute the XOR of given byte arrays returns error if the bytes are not of same length

func CommonPrefixLen

func CommonPrefixLen(a, b []byte) int

CommonPrefixLen computes the Common Prefix Length of the given byte slices. It XORs them and find the leading zeroes.

func Distance

func Distance(a, b []byte) *big.Int

Distance computes the XOR dist between two byte arrays

func Hash

func Hash(src []byte) []byte

Hash sha256 's the given byte

func LogDistance

func LogDistance(a, b []byte) int

LogDistance Log dist: length - leading zero count

Types

This section is empty.

Jump to

Keyboard shortcuts

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