- From: Christopher William Turner <cwturner@cycom.co.uk>
- Date: Tue, 6 Apr 1999 12:26:16 -0400 (EDT)
- To: "www-jigsaw@w3.org" <www-jigsaw@w3.org>
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