Md5 fault fixed.

I have fixed a deprecation warning in my copy of
Jigsaw 2.0.1 org/w3c/tools/crypt/Md5.java

The warning was significant since the deprecated method did not
correctly
convert a String to bytes (would only handle ascii text correctly).
My fix should give the same checksums as the old version
for ascii text and will now also
handle all unicode characters.

My fixed constructor starts as follows:-

    /**
     * Construct a digestifier for the given string.
     * @param input The string to be digestified.
     */

    public Md5 (String input) {
 byte bytes [] = null;
 try {
     bytes = input.getBytes ("UTF8");
 } catch(UnsupportedEncodingException e){
     throw new RuntimeException("no UTF8 encoding!!!");
 }
 this.stringp = true ;
 this.in      = new ByteArrayInputStream (bytes) ;

.....

--
Chris Turner, http://www.cycom.co.uk/

Received on Tuesday, 6 April 1999 13:33:11 UTC