Skip to content

Instantly share code, notes, and snippets.

@matovitch
Last active December 21, 2015 14:49
Show Gist options
  • Save matovitch/6322809 to your computer and use it in GitHub Desktop.
Save matovitch/6322809 to your computer and use it in GitHub Desktop.
Home made locality sensitive hashing : test.
#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