2dfaa409c9606bdc532fb165668f0e2482e60ed9.svn-base 965 B

12345678910111213141516171819202122232425262728
  1. if (!dojo._hasResource["dojox.crypto.tests.MD5"]) { // _hasResource checks added
  2. // by build. Do not use
  3. // _hasResource directly in
  4. // your code.
  5. dojo._hasResource["dojox.crypto.tests.MD5"] = true;
  6. dojo.provide("dojox.crypto.tests.MD5");
  7. dojo.require("dojox.crypto.MD5");
  8. (function() {
  9. var message = "The rain in Spain falls mainly on the plain.";
  10. var base64 = "OUhxbVZ1Mtmu4zx9LzS5cA==";
  11. var hex = "3948716d567532d9aee33c7d2f34b970";
  12. var s = "9HqmVu2\xD9\xAE\xE3<}/4\xB9p";
  13. var dxc = dojox.crypto;
  14. tests.register("dojox.crypto.tests.MD5", [
  15. function testBase64Compute(t) {
  16. t.assertEqual(base64, dxc.MD5.compute(message));
  17. }, function testHexCompute(t) {
  18. t.assertEqual(hex, dxc.MD5.compute(message,
  19. dxc.outputTypes.Hex));
  20. }, function testStringCompute(t) {
  21. t.assertEqual(s, dxc.MD5.compute(message,
  22. dxc.outputTypes.String));
  23. }]);
  24. })();
  25. }