package
0.2.1
Repository: https://github.com/icub3d/gop.git
Documentation: pkg.go.dev

# README

algo

GoDoc

Various common computer science algorithms implemented in Go.

This library is still in its early stages and is likely to change dramatically over time.

# Functions

DifferenceBitSets creates a new BitSet whose bits are set only if they are in the first BitSet but in none of the rest of the BitSets.
IntersectBitSets creates a new BitSet whose bits are set only if that bit is set in all of the given BitSets.
Levenshtein calculates the levenshtein distance between the two given strings.
Luhn calculates the Luhn checksum of the given number using the Luhn algorithm: http://en.wikipedia.org/wiki/Luhn_algorithm.
LuhnAppend appends the Luhn checksum to the given number.
LuhnCheck verifies the checksum (the last digit) of the given number using the Luhn algorithm: http://en.wikipedia.org/wiki/Luhn_algorithm.
MaxInt returns the largest integer among all of the given integers.
MinInt returns the smallest integer among all of the given integers.
NewBitSet creates a BitSize of size n bits.
NewBloomFilter creates a bloom filter of size m and with k hashes.
NewBloomFilterEstimate creates a bloom filter with a size and number of hashes based on the given estimated number of values being added and the desired false positive rate.
NewMerkleTree creates a Merkle tree from the given data using the given hash.
NewMerkleTreeFromHashes creates a Merkle tree from the given hashes of data.
NPIChecksum returns the Luhn checksum for the given number.
NPIChecksumAppend calculates the checksum for the given partial NPI and appends the checksum to it.
NPIChecksumCheck calculates and verifies the checksum using the Luhn algorithm.
UnionBitSets creates a new BitSet with all the bits set from the given BitSets.
VerifyMerkleProof uses the given proof to verify that the lineage given is valid.

# Variables

ErrInvalidParams means that you gave the function something unexpected.
ErrNotFound means that the operation was unable to find what you were looking for.
ErrNotImplemented means that the operation is not implemented.
ErrOutOfRange means that the operation was unable to to do what you asked because the parameters for the request were outside of the limits.
ErrWrongType means that the wrong type was given.

# Structs

BloomFilter is a representation of the bloom filter data structure.
MerkleProofNode represents a node in a merkle tree that is used when proving membership of a leaf node.

# Type aliases

BitSet is a set of bit that can be turned on/off.
MerkleTree is an implementation of a Merkle tree (see: http://en.wikipedia.org/wiki/Merkle_tree).