...

Text file src/github.com/zeebo/xxh3/_compat.c

Documentation: github.com/zeebo/xxh3

     1#include "upstream/xxhash.h"
     2#include <stdio.h>
     3
     4int main() {
     5    unsigned char buf[4096];
     6    for (int i = 0; i < 4096; i++) {
     7        buf[i] = (unsigned char)((i+1)%251);
     8    }
     9
    10    printf("var testVecs64 = []uint64{\n");
    11    for (int i = 0; i < 4096; i++) {
    12        if (i % 4 == 0) {
    13            printf("\t");
    14        }
    15
    16        uint64_t h = XXH3_64bits(buf, (size_t)i);
    17        printf("0x%lx, ", h);
    18
    19        if (i % 4 == 3) {
    20            printf("\n\t");
    21        }
    22    }
    23    printf("}\n\n");
    24
    25    printf("var testVecs128 = [][2]uint64{\n");
    26    for (int i = 0; i < 4096; i++) {
    27        if (i % 4 == 0) {
    28            printf("\t");
    29        }
    30
    31        XXH128_hash_t h = XXH3_128bits(buf, (size_t)i);
    32        printf("{0x%lx, 0x%lx}, ", h.high64, h.low64);
    33
    34        if (i % 4 == 3) {
    35            printf("\n");
    36        }
    37    }
    38    printf("}\n\n");
    39}

View as plain text