test_siphash.c
This file
Path
tests/test_siphash.c
21 lines · 463 bytes · C
Last changed by
add stb_ds.h and testsSean Barrettbefore adoption477471d
History of this fileTake it
1#include <stdio.h>23#define STB_DS_IMPLEMENTATION4#define STBDS_SIPHASH_2_45#define STBDS_TEST_SIPHASH_2_46#include "../stb_ds.h"78int main(int argc, char **argv)9{10 unsigned char mem[64];11 int i,j;12 for (i=0; i < 64; ++i) mem[i] = i;13 for (i=0; i < 64; ++i) {14 size_t hash = stbds_hash_bytes(mem, i, 0);15 printf(" { ");16 for (j=0; j < 8; ++j)17 printf("0x%02x, ", (unsigned char) ((hash >> (j*8)) & 255));18 printf(" },\n");19 }20 return 0;21}