convert byte to string
Posted on 2007-11-19
I am trying to convert a byte array to a string. I've followed some of the suggestions here on ee, but it doesn't seem to work. I have:
byte uPW = pwCrypt(request.getParameter("password"));
String usrPW = new String(uPW,"ASCII");
My pwCrypt() function does return a byte. After the String() constructor I display both the encrypted uPW byte and the usrPW String. The byte displays properly, but the String is gobbletygook; nothing resembling the original byte array value. What am I doing wrong?