Skip to content

Node.js binding for the ssdeep CTPH library

License

Notifications You must be signed in to change notification settings

memcorrupt/fast-ssdeep

Repository files navigation

fast-ssdeep

Version Downloads Build Status License

Node.js binding for the ssdeep CTPH library.

ssdeep project website

Installation

Install the fast-ssdeep package from the NPM registry using your package manager of choice.

Example:

npm install fast-ssdeep
# or
yarn add fast-ssdeep
# or
pnpm install fast-ssdeep

Documentation

ssdeep.hash(contents: string|Buffer): Promise<string>

Asynchronously calculate an ssdeep hash based on the contents argument, which can be a string or Buffer.

ssdeep.hashSync(contents: string|Buffer): string

Synchronously calculate an ssdeep hash based on the contents argument, which can be a string or Buffer.

ssdeep.compare(hash1: string, hash2: string): Promise<number>

Asynchronously compare two ssdeep hashes to generate a similarity score. Both hashes must be passed as strings, and a similarity between 0-100 will be returned.

ssdeep.compareSync(hash1: string, hash2: string): number

Synchronously compare two ssdeep hashes to generate a similarity score. Both hashes must be passed as strings, and a similarity between 0-100 will be returned.