Skip to content

Latest commit

 

History

History
80 lines (63 loc) · 2.25 KB

File metadata and controls

80 lines (63 loc) · 2.25 KB
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 AsyncExperimental

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 AsyncExperimental

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 SyncExperimental

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 SyncExperimental

hashsig.free();

Hashsig.OPTION ENUM

| Flag | Value | | --- | --- | --- | | Hashsig.OPTION.NORMAL | 0 | | Hashsig.OPTION.IGNORE_WHITESPACE | 1 | | Hashsig.OPTION.SMART_WHITESPACE | 2 | | Hashsig.OPTION.ALLOW_SMALL_FILES | 4 |