v1.0.0 Latest Latest

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

Go to latest
Published: Sep 6, 2020 License: Apache-2.0 Imports: 0 Imported by: 1




This section is empty.


This section is empty.


This section is empty.


type HammingDistance

type HammingDistance int

HammingDistance represents the distance between two hashes

type PerceptualHash

type PerceptualHash interface {
	// String returns the hash as a string, usually a hexadecimal representation
	String() string

PerceptualHash represents the hash of an image

type PerceptualHashImplementation

type PerceptualHashImplementation interface {

	// Handle returns a canonical name for the hashing service
	// use it so you can refer to the specific algorithm later
	GetHandle() string

	// HashFromPath creates a hash from an image file at the given path
	HashFromPath(path string) (PerceptualHash, error)

	// HashFromString recreates a hash from a hash string
	// use it to recreate a hash from a stored value
	HashFromString(hashAsString string) (PerceptualHash, error)

	// Distance calculates the hamming distance between two hashes
	Distance(hash1 PerceptualHash, hash2 PerceptualHash) (HammingDistance, error)

Jump to

Keyboard shortcuts

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