diff doodle/utils/prog/hash_test.d @ 112:b569d7d5064f

Added some utilities that are a work in progress.
author David Bryant <bagnose@gmail.com>
date Thu, 14 Apr 2011 11:27:17 +0930
parents
children 8343c1dafac6
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doodle/utils/prog/hash_test.d	Thu Apr 14 11:27:17 2011 +0930
@@ -0,0 +1,35 @@
+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 % 1000 == 0) {
+            writefln("%s %s", count, digest);
+        }
+
+        //writefln("%s %s", count, digest);
+    }
+
+    return 0;
+}