edu.georgetown.gucs.fingerprinter
Class HashFingerprinter
java.lang.Object
edu.georgetown.gucs.fingerprinter.Fingerprinter
edu.georgetown.gucs.fingerprinter.HashFingerprinter
public class HashFingerprinter
- extends Fingerprinter
Creates a fingerprint that consist of a SHA-1 hash value representing the presence or absence of terms in a
particular dictionary
- Author:
- Clay Shields
Fields inherited from class edu.georgetown.gucs.fingerprinter.Fingerprinter |
base64Fingerprint, byteRun, creatingProgram, creator, dictionary, diskImage, fingerprintName, GUID, showDataSource, showDictionary, showDigest, systemID, targetFile, tokenizers, unknownTokens, version, volume |
Constructor Summary |
HashFingerprinter()
Constructor that generates the fingerprint name, version, unique identifier (GUID), system identifier, and creating
program. |
HashFingerprinter(java.lang.String dictionaryFilename)
Constructor that loads a dictionary and its tokenizers. |
Method Summary |
byte[] |
computeFingerprint(java.lang.String filename)
Computes a SHA-1 hash value byte array fingerprint |
static void |
main(java.lang.String[] args)
|
java.lang.String |
SHA1(java.util.Iterator<java.lang.String> tokens)
Computes a SHA-1 hash value indicating the presence or absence of each token in this dictionary |
Methods inherited from class edu.georgetown.gucs.fingerprinter.Fingerprinter |
computeFingerprintXML, generateCreatingProgram, generateXML, getBase64Fingerprint, getCreatingProgram, getDictionary, getFingerprintName, loadFingerprintXML, loadFingerprintXML, outputFields, setCreator, setDictionary, setDictionary, setMangler, setMangler, setManglerRNG, setOutput, setTerse, setVerbose |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HashFingerprinter
public HashFingerprinter()
- Constructor that generates the fingerprint name, version, unique identifier (GUID), system identifier, and creating
program. Sets the fingerprinter output to display all available information.
HashFingerprinter
public HashFingerprinter(java.lang.String dictionaryFilename)
- Constructor that loads a dictionary and its tokenizers. Generates the fingerprint name, version, unique identifier
(GUID), system identifier, and creating program. Sets the fingerprinter output to display all available
information.
- Parameters:
dictionaryFilename
- the filename containing the dictionary to use for this fingerprinter
computeFingerprint
public byte[] computeFingerprint(java.lang.String filename)
- Computes a SHA-1 hash value byte array fingerprint
- Overrides:
computeFingerprint
in class Fingerprinter
- Parameters:
filename
- the string filename of the document to fingerprint
- Returns:
- the byte array containing the fingerprint
SHA1
public java.lang.String SHA1(java.util.Iterator<java.lang.String> tokens)
- Computes a SHA-1 hash value indicating the presence or absence of each token in this dictionary
- Parameters:
tokens
- the string iterator over the tokens in this dictionary
- Returns:
- the string for the resulting SHA-1 hash value
main
public static void main(java.lang.String[] args)