This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clr | |
from System import Array, DateTime | |
from System.String import Format | |
from System.IO import File, DirectoryInfo, Path, Directory | |
clr.AddReference("TCAdmin.SDK") | |
from TCAdmin.SDK.Misc import CompressionTools | |
base_dir = ThisService.WorkingDirectory | |
files = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This can take a long time to run. It emits each result as it finds it. | |
findMatches.prototype.find = function(hash) { | |
console.log('Searching for hash: ' + hash); | |
for (var i=0; i < hashes.length; i++) { | |
if (hamming(hash, hashes[i].hash) < 10) { | |
console.log('emiiting match'); | |
this.emit('found-match', hashes[i]); | |
} | |
} |