This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // # Assume salt, password, and encodedPassword are all strings. | |
| // # If you don't have a salt, just have a random number generator spit out > 16B of data, and turn that into a string. | |
| // Java - SHA256 with Salt | |
| import java.security.MessageDigest; | |
| import sun.misc.BASE64Encoder; | |
| MessageDigest digest = MessageDigest.getInstance("SHA-256"); | |
| digest.reset(); |