view doodle/utils/prog/hash_test.d @ 119:8343c1dafac6

Make it compile under latest GtkD. Rewrote dupes.d as a single function
author David Bryant <bagnose@gmail.com>
date Thu, 21 Apr 2011 18:12:13 +0930
parents b569d7d5064f
children
line wrap: on
line source

import std.stdio;
import std.random;
import std.string;

int main(string[] args) {
    /*
    struct S {
        string[] names;
    }
    */

    bool[ubyte[16]] aa;

    for (int count = 0; ; ++count) {
        ubyte[16] digest;
        foreach (ref a; digest) {
            a = cast(ubyte)uniform(0, 256);
        }

        /*
        auto s = S();
        s.names ~= "hello";
        aa[digest] = s;
        */
        aa[digest] = true;

        if (count % 10000 == 0) {
            writefln("%s %3s", count, digest);
        }

        //writefln("%s %s", count, digest);
    }

    return 0;
}