Skip to content

Generates a unique fingerprint for documents and strings

License

Notifications You must be signed in to change notification settings

Emirati/doc-fingerprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOC-FINGERPRINT

This library provides a way to generate a unique fingerprint for documents based on their content.

Installation

npm install doc-fingerprint

Supported Algorithms

The library currently supports the following algorithms:

  • Winnowing Fingerprint
  • Hashing Fingerprint (MD5, SHA1, SHA256)

Usage

import { HashFingerprint, HashAlgorithm } from 'doc-fingerprint';

// Using a hash algorithm
const hashFingerprint = new HashFingerprint({algorithm: HashAlgorithm.SHA1});

// Generate fingerprint from text
const fingerprint = winnowingFingerprint.fromText("This is a sample text").generate();
// Verify fingerprint
const isValid = winnowingFingerprint.fromText("This is a sample text").verify(fingerprint, {algorithm: HashAlgorithm.SHA1});

About

Generates a unique fingerprint for documents and strings

Resources

License

Stars

Watchers

Forks

Packages

No packages published