A fast image hash generator and hamming distance calculator using multiple algorithms
npm install img-hasher
const { getHash } = require('img-hasher');
const hash = await getHash('https://example.com/image.jpg');
const { hammingDistance } = require('img-hasher');
const distance = await hammingDistance('https://example.com/image1.jpg', 'https://example.com/image2.jpg');
const { getHash, hammingDistanceFromHash } = require('img-hasher');
const hash1 = await getHash('https://example.com/image1.jpg');
const hash2 = await getHash('https://example.com/image2.jpg');
const distance = hammingDistanceFromHash(hash1, hash2);
- Mean
- Gradient
- VertGradient
- DoubleGradient
- BlockHash