Crate blockhash

Crate blockhash 

Source
Expand description

A perceptual hashing algorithm for detecting similar images.

This is an implementation of the Blockhash algorithm, and can produce 16-, 64-, 144-, and 256-bit perceptual hashes.

§Examples

Basic usage:

use blockhash::blockhash64;

let img = image::open("images/example.png").unwrap();
let hash = blockhash64(&img);

assert_eq!(hash.to_string(), "c7c48f8989c77e0c");

§Feature flags

  • std: Enables features that require the Rust Standard Library (enabled by default).
  • image: Enables integration with the image crate (enabled by default).

Structs§

Blockhash16
A 16-bit hash digest.
Blockhash64
A 64-bit hash digest.
Blockhash144
A 144-bit hash digest.
Blockhash256
A 256-bit hash digest.
BlockhashParseError
An error that can be returned when parsing a hexadecimal string into a hash digest.

Traits§

Image
Image data.

Functions§

blockhash16
Generates a 16-bit perceptual hash of an image.
blockhash64
Generates a 64-bit perceptual hash of an image.
blockhash144
Generates a 144-bit perceptual hash of an image.
blockhash256
Generates a 256-bit perceptual hash of an image.