Last active
December 21, 2015 14:49
-
-
Save matovitch/6322809 to your computer and use it in GitHub Desktop.
Home made locality sensitive hashing : test.
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "mylsh.h" | |
int main(int argc, char** argv) { | |
if (argc != 3) | |
return EXIT_FAILURE; | |
uint32_t hash_size = atoi(argv[1]); | |
uint8_t* hash = (uint8_t*)calloc(hash_size, sizeof(uint8_t)); | |
uint8_t* data = argv[2]; | |
uint32_t data_size = strlen(data); | |
mylsh(hash, hash_size, data, data_size); | |
for (uint32_t i = 0; i < hash_size; i++) { | |
printf("%2.2X", hash[i]); | |
} | |
printf("\n"); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment