Skip to content

Generate content-based image hashes on Node.js.

License

Notifications You must be signed in to change notification settings

ray-1337/perceptual-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perceptual Hash

Generate content-based image hashes on Node.js.

Installation

pnpm add perceptual-hash
npm add perceptual-hash
yarn add perceptual-hash

Usage

import { generateHash } from "perceptual-hash";

const imageHash = await generateHash(new Uint8Array(Buffer.from(imageBufferHere)));
// => 0773063f063f36070e...

API

generateHash(Uint8Array, bits?: number); // => Promise<string | null>

License

MIT