layout
default
menu_item
api
title
Hashsig
description
Version 0.19.0
return_to
API Documentation Index
/api/
sections
create
createFromFile
#compare
#free
OPTION
#create
#createFromFile
#compare
#free
#OPTION
Hashsig. create Async Experimental
Hashsig . create ( buf , buflen , opts ) . then ( function ( hashsig ) {
// Use hashsig
} ) ;
Parameters
Type
buf
String
The input buffer.
buflen
Number
The input buffer size.
opts
Number
The signature computation options (see above).
Returns
Hashsig
The computed similarity signature.
Hashsig. createFromFile Async Experimental
Hashsig . createFromFile ( path , opts ) . then ( function ( hashsig ) {
// Use hashsig
} ) ;
Parameters
Type
path
String
The path to the input file.
opts
Number
The signature computation options (see above).
Returns
Hashsig
The computed similarity signature.
Hashsig# compare Sync Experimental
var result = hashsig . compare ( b ) ;
| Parameters | Type |
| --- | --- | --- |
| b | Hashsig | The second similarity signature to compare. |
Returns
Number
[0 to 100] on success as the similarity score, or error code.
Hashsig# free Sync Experimental
| Flag | Value |
| --- | --- | --- |
| Hashsig.OPTION. NORMAL | 0 |
| Hashsig.OPTION. IGNORE_WHITESPACE | 1 |
| Hashsig.OPTION. SMART_WHITESPACE | 2 |
| Hashsig.OPTION. ALLOW_SMALL_FILES | 4 |