algorithm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashBytesWithCryptoFunc

func HashBytesWithCryptoFunc(b []byte, hash crypto.Hash) *hashData

func HashString

func HashString(s string) *hashData

Types

type Dictionary

type Dictionary map[uint64]string

Dictionary records the mapping between hash value and string.

func (*Dictionary) AddToDict

func (d *Dictionary) AddToDict(entry string) (uint64, error)

AddToDict converts a string in a hash value and add this pair of string and hash to the local Dictionary. It returns the hash value of the string and errors out if there exist hash collision or hash convection error.

func (*Dictionary) LookupDict

func (d *Dictionary) LookupDict(hash uint64) (string, error)

LookupDict returns string that maps to the hash value. The function returns error if hash value does not exist in the Dictionary or the mapped string is empty.

type SyncType

type SyncType string
const (
	// string reconciliation
	RCDS SyncType = "RecursiveContentDependentShingling"
	// set reconciliation
	IBLT     SyncType = "InvertibleBloomLookupTable"
	CPI      SyncType = "CharacteristicPolynomialInterpolation"
	InterCPI SyncType = "InteractiveCharacteristicPolynomialInterpolation"
	FullSync SyncType = "FullSync"
	// set difference estimation
	StrataEst SyncType = "StrataEstimation"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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