Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blockhash-core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blockhash-core

This is the core implementation of the [blockhash perceptual image hashing algorithm](http://blockhash.io).

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.9K
decreased by-26.29%
Maintainers
1
Weekly downloads
 
Created
Source

Blockhash Core

This is the core implementation of the blockhash perceptual image hashing algorithm.

Look at the main blockhash package if you want a higher level api.

Installation

npm install --save blockhash-core

Usage

const { bmvbhash } = require('blockhash')

const image = new ImageData(/* ... */)
const result = bmvbhash(image, 16)

console.log(result)
//=> f81bf99ffb803400e07f8c5d849f049707033a033fe33fe1bfe00e618ee30ca7

API

bmvbhash(data, bits)

  • data (ImageData, required) - The input image data
  • bits (number, required) - Create hash of size N^2 bits
  • returns string - The resulting hash in hex format

Precise but slower, non-overlapping blocks.

This method is recommended as a good tradeoff between speed and good matches on any image size.

bmvbhashEven(data, bits)

  • data (ImageData, required) - The input image data
  • bits (number, required) - Create hash of size N^2 bits
  • returns string - The resulting hash in hex format

Quick and crude, non-overlapping blocks.

This method is only advisable when the image width and height are an even multiple of the number of blocks used.

FAQs

Package last updated on 07 Dec 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc