I would like to use the Base64 encoder of the package sun.misc.BASE64Encoder, because I need to encode the password. However, an error occurs while entering the import for this package.
The message in which the code for the encoder should be used is as follows:
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 that does the same thing? Or maybe someone knows how to get the code of the original class, maybe please?
thanks:)
source share