Opened 14 years ago

Closed 14 years ago

#183 closed defect (invalid)

MD5 does not calculate correctly.

Reported by: wey@… Owned by: anonymous
Priority: high Milestone:
Component: Core Version: 0.1
Keywords: md5 Cc:
Blocked By: Blocking:

Description

Index: MD5.js
===================================================================
--- MD5.js      (revision 2021)
+++ MD5.js      (working copy)
@@ -22,8 +22,8 @@
        }
        function roll(num,cnt) { return (num<<cnt)|(num>>>(32-cnt)); }
        this.compute=function(x,len) {
+               if (!len) var len=x.length*chrsz;
                if (typeof(x)=="string") x=dojo.crypto.toByteArray(x);
-               if (!len) var len=x.length;
                x[len>>5]|=0x80<<((len)%32);
                x[(((len+64)>>>9)<<4)+14]=len;
                var a= 1732584193;

Something else... would it make sense to set chrsz's value based on djConfig option?

djConfig.unicode = true; chrsz = djConfig.unicode?16:8;

Change History (1)

comment:1 Changed 14 years ago by ttrenka@…

Resolution: invalid
Status: newclosed

MD5 is still unreleased code, and undergoing a *lot* of rework. I'm going to close this bug and keep unicode support in mind.

Note: See TracTickets for help on using tickets.