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