🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

img-hasher

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

img-hasher

A fast image hash generator and hamming distance calculator using multiple algorithms

0.0.7
Source
npm
Version published
Weekly downloads
5
-80%
Maintainers
1
Weekly downloads
 
Created
Source

Image Hasher

A fast image hash generator and hamming distance calculator using multiple algorithms

Installation

npm install img-hasher

Usage

Get Hash Of an Image

const { getHash } = require('img-hasher');
const hash = await getHash('https://example.com/image.jpg');

Get Hash Distance Between Two Images

const { hammingDistance } = require('img-hasher');
const distance = await hammingDistance('https://example.com/image1.jpg', 'https://example.com/image2.jpg');

Get Hash Distance Between Two Hashes

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);

Algorithms

  • Mean
  • Gradient
  • VertGradient
  • DoubleGradient
  • BlockHash

Keywords

hash

FAQs

Package last updated on 14 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts