1 /++
2 DAuth v0.6.2 - Salted Hashed Password Library for D
3 
4 Writen in the D programming language.
5 
6 Tested with DMD 2.064.2 through DMD 2.067.0
7 
8 Homepage:
9 $(LINK https://github.com/abscissa/DAuth)
10 
11 This_API_Reference:
12 $(LINK http://semitwist.com/dauth)
13 
14 DMD flags to enable DAuth unittests:
15 -------------------
16 -unittest -version=DAuth_AllowWeakSecurity -version=DAuth_Unittest
17 -------------------
18 
19 DMD flags to enable DAuth unittests, but silence all non-error output:
20 -------------------
21 -unittest -version=DAuth_AllowWeakSecurity -version=DAuth_Unittest -version=DAuth_Unittest_Quiet
22 -------------------
23 
24 Note that dauth.sha is not automatically included by "import dauth;" and must
25 be imported separately. This is because it's only in DAuth temporarily (until
26 SHA-2 is in Phobos). On compilers where SHA-2 exists in Phobos (ie, DMD 2.066
27 and up), then DAuth does NOT use dauth.sha.
28 
29 The module dauth.hashdrbg is also excluded by default because a Phobos pull request
30 is in the works.
31 
32 Import all:
33 ------------
34 import dauth;
35 import dauth.sha;
36 import dauth.hashdrbg;
37 ------------
38 
39 Copyright: © 2014 Nick Sabalausky
40 License: zlib/libpng license, provided in
41 	$(LINK2 LICENSE.txt, https://github.com/Abscissa/DAuth/blob/master/LICENSE.txt).
42 Authors: Nick Sabalausky
43 +/
44 
45 module dauth;
46 
47 public import dauth.core;
48 public import dauth.random;
49 
50 version(DAuth_Unittest)
51 {
52 	import dauth.sha;
53 	import dauth.hashdrbg;
54 
55 	unittest
56 	{
57 		import std.process;
58 
59 		unitlog("Testing different results on different executions");
60 		assert(
61 			spawnShell(`rdmd --build-only --force -Isrc -ofbin/genBytes genBytes.d`).wait()
62 			== 0, "Failed to compile genBytes.d"
63 		);
64 		enum cmd = "bin/genBytes";
65 		auto result1 = execute(cmd);
66 		auto result2 = execute(cmd);
67 		auto result3 = execute(cmd);
68 		assert(result1.status == 0, "Command failed: "~cmd);
69 		assert(result2.status == 0, "Command failed: "~cmd);
70 		assert(result3.status == 0, "Command failed: "~cmd);
71 
72 		assert(result1.output != result2.output);
73 		assert(result2.output != result3.output);
74 		assert(result3.output != result1.output);
75 	}
76 }