modulepackage
0.0.0-20160322163242-5b898ac5add1
Repository: https://github.com/whyrusleeping/go-keyspace.git
Documentation: pkg.go.dev
# README
go-keyspace
This is a package extracted from go-ipfs.
Its purpose it to be used to compare a set of keys based on a given metric. The primary metric used is XOR, as in kademlia.
# Functions
SortByDistance takes a KeySpace, a center Key, and a list of Keys toSort.
XOR takes two byte slices, XORs them together, returns the resulting slice.
ZeroPrefixLen returns the number of consecutive zeroes in a byte slice.
# Variables
XORKeySpace is a KeySpace which: - normalizes identifiers using a cryptographic hash (sha256) - measures distance by XORing keys together.
# Interfaces
KeySpace is an object used to do math on identifiers.