online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Base64; public class Main { public static void main(String[] args){ System.out.println(makeHash("password","[email protected]")); } private static final String SHA_256 = "SHA-256"; private Main() { try { MessageDigest.getInstance(SHA_256); } catch (NoSuchAlgorithmException e) { } } public static String makeHash(String password, String salt) { try { MessageDigest md = MessageDigest.getInstance(SHA_256); md.update(password.getBytes(StandardCharsets.UTF_8)); byte[] byteData = md.digest(makeHash(salt.toLowerCase())); return Base64.getEncoder().encodeToString(byteData); } catch (Exception e) { //ignore, will never happen. } return password; } private static byte[] makeHash(String val) throws NoSuchAlgorithmException { return MessageDigest.getInstance(SHA_256).digest(val.getBytes(StandardCharsets.UTF_8)); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue