PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/specs/hashes/sha256.ds

http://github.com/wilkie/djehuty
Unknown | 19 lines | 15 code | 4 blank | 0 comment | 0 complexity | ad45a6982b44a4c7610fdb44a1285c78 MD5 | raw file
 1module specs.hashes.sha256;
 2
 3import testing.support;
 4
 5import hashes.sha256;
 6
 7describe SHA256() {
 8	describe hash() {
 9		it should_hash_as_expected_for_string_literals() {
10			string s = HashSHA256.hash("a").toString();
11			should(s == "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb");
12		}
13
14		it should_hash_the_empty_string() {
15			string s = HashSHA256.hash("").toString();
16			should(s == "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
17		}
18	}
19}