I would like to use the Base64 encoder of the package sun.misc.BASE64Encoder because I need to encode a password. However an error is being generated when I type in the import for this package.
the message where the code for the encoder is to be used is the following:
private synchronized static String hash(final String username, final String password) {
DIGEST.reset();
return new BASE64Encoder().encode(DIGEST.digest((username.toLowerCase() + password).getBytes()));
}
Is there an equivalent class in java which does the same thing? Or maybe, does someone know how to be able to get the code of the original class maybe please?
thanks :)