File: test_vector.cpp

package info (click to toggle)
wyhash 0~2.gbp234f0c6-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,168 kB
  • sloc: ansic: 1,832; cpp: 272; sh: 41; makefile: 27
file content (21 lines) | stat: -rw-r--r-- 603 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <vector>
#include "wyhash.h"
using namespace std;

int main(void) {
    vector<string> v = {
        "",
        "a",
        "abc",
        "message digest",
        "abcdefghijklmnopqrstuvwxyz",
        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
        "1234567890123456789012345678901234567890123456789012345678901234567890"
        "1234567890"};
    for (size_t i = 0; i < v.size(); i++) {
        cout << "wyhash(\"" << v[i] << "\"," << i << ")=" << hex
             << wyhash(v[i].c_str(), v[i].size(), i, _wyp) << '\n';
    }
    return 0;
}