PHP Manual (Partial)

Table of Contents

ssdeep Fuzzy Hashing

Table of Contents

Introduction

ssdeep is a utility for creating and comparing fuzzy hashes or » context-triggered piecewise hashing.

Fuzzy hashing can match signatures which have "...sequences of identical bytes in the same order, although bytes in between these sequences may be different in both content and length". (» ssdeep project page)

This extension provides functions for creating and comparing fuzzy hashes.


Installing/Configuring

Table of Contents

Requirements

This extension requires the » ssdeep library.


Installation

This » PECL extension is not bundled with PHP.

Information for installing this PECL extension may be found in the manual chapter titled Installation of PECL extensions. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: » http://pecl.php.net/package/ssdeep.


Runtime Configuration

This extension has no configuration directives defined in php.ini.


Resource Types

This extension has no resource types defined.



Predefined Constants

This extension has no constants defined.


ssdeep Functions

ssdeep_fuzzy_compare

Calculates the match score between two fuzzy hash signatures

Description

integer ssdeep_fuzzy_compare ( string $signature1 , string $signature2 )

Calculates the match score between signature1 and signature2 using » context-triggered piecewise hashing, and returns the match score.

Parameters

signature1

The first fuzzy hash signature string.

signature2

The second fuzzy hash signature string.

Return Values

Returns an integer from 0 to 100 on success, FALSE otherwise.


ssdeep_fuzzy_hash_filename

Create a fuzzy hash from a file

Description

string ssdeep_fuzzy_hash_filename ( string $file_name )

ssdeep_fuzzy_hash_filename calculates the hash of the file specified by file_name using » context-triggered piecewise hashing, and returns that hash.

Parameters

file_name

The filename of the file to hash.

Return Values

Returns a string on success, FALSE otherwise.


ssdeep_fuzzy_hash

Create a fuzzy hash from a string

Description

string ssdeep_fuzzy_hash ( string $to_hash )

ssdeep_fuzzy_hash calculates the hash of to_hash using » context-triggered piecewise hashing, and returns that hash.

Parameters

to_hash

The input string.

Return Values

Returns a string on success, FALSE otherwise.


Table of Contents