Last active
May 6, 2019 15:48
-
-
Save jcbf/ce9c1a9c4c8646c0577c967065ba5eb9 to your computer and use it in GitHub Desktop.
perl ssdeep
This file contains hidden or 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
git clone https://github.com/hideo55/Data-FuzzyHash.git | |
sudo aptitude install libfuzzy-dev | |
cd Data-FuzzyHash/ | |
cpanm --sudo Module::Build::XSUtil | |
# handle \0 in buffer | |
# diff --git a/xs/FuzzyHash.xs b/xs/FuzzyHash.xs | |
#index 272d2aa..21da3e2 100644 | |
#--- a/xs/FuzzyHash.xs | |
#+++ b/xs/FuzzyHash.xs | |
#@@ -10,11 +10,14 @@ MODULE = Data::FuzzyHash PACKAGE = Data::FuzzyHash | |
# PROTOTYPES: DISABLE | |
# | |
# SV* | |
#-fuzzy_hash(const char* str) | |
#+fuzzy_hash(SV *string ) | |
# CODE: | |
# { | |
# char result[FUZZY_MAX_RESULT]; | |
#- int status = fuzzy_hash_buf((const unsigned char*)str, strlen(str), result); | |
#+ STRLEN len; | |
#+ char *str = SvPV( string, len ); | |
#+ | |
#+ int status = fuzzy_hash_buf((const unsigned char *)str, len, result); | |
# if( status != 0 ){ | |
# croak("Failed to calculate hash value."); | |
# } | |
echo "ZGlmZiAtLWdpdCBhL3hzL0Z1enp5SGFzaC54cyBiL3hzL0Z1enp5SGFzaC54cwppbmRleCAyNzJkMmFhLi4yMWRhM2UyIDEwMDY0NAotLS0gYS94cy9GdXp6eUhhc2gueHMKKysrIGIveHMvRnV6enlIYXNoLnhzCkBAIC0xMCwxMSArMTAsMTQgQEAgTU9EVUxFID0gRGF0YTo6RnV6enlIYXNoIFBBQ0tBR0UgPSBEYXRhOjpGdXp6eUhhc2gKIFBST1RPVFlQRVM6IERJU0FCTEUKIAogU1YqCi1mdXp6eV9oYXNoKGNvbnN0IGNoYXIqIHN0cikKK2Z1enp5X2hhc2goU1YgKnN0cmluZyApCiBDT0RFOgogewogICAgIGNoYXIgcmVzdWx0W0ZVWlpZX01BWF9SRVNVTFRdOwotICAgIGludCBzdGF0dXMgPSBmdXp6eV9oYXNoX2J1ZigoY29uc3QgdW5zaWduZWQgY2hhciopc3RyLCBzdHJsZW4oc3RyKSwgcmVzdWx0KTsKKwkJU1RSTEVOIGxlbjsKKyAgICBjaGFyICpzdHIgPSBTdlBWKCBzdHJpbmcsIGxlbiApOworCisgICAgaW50IHN0YXR1cyA9IGZ1enp5X2hhc2hfYnVmKChjb25zdCB1bnNpZ25lZCBjaGFyICopc3RyLCBsZW4sIHJlc3VsdCk7CiAgICAgaWYoIHN0YXR1cyAhPSAwICl7CiAgICAgICAgIGNyb2FrKCJGYWlsZWQgdG8gY2FsY3VsYXRlIGhhc2ggdmFsdWUuIik7CiAgICAgfQo=" | base64 -d - | patch -p1 | |
perl ./Build.PL && sudo perl ./Build install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment