/specs/hashes/sha256.ds

http://github.com/wilkie/djehuty · Unknown · 19 lines · 15 code · 4 blank · 0 comment · 0 complexity · ad45a6982b44a4c7610fdb44a1285c78 MD5 · raw file

  1. module specs.hashes.sha256;
  2. import testing.support;
  3. import hashes.sha256;
  4. describe SHA256() {
  5. describe hash() {
  6. it should_hash_as_expected_for_string_literals() {
  7. string s = HashSHA256.hash("a").toString();
  8. should(s == "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb");
  9. }
  10. it should_hash_the_empty_string() {
  11. string s = HashSHA256.hash("").toString();
  12. should(s == "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
  13. }
  14. }
  15. }