import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Hash { public static String sha256(String input) { try { MessageDigest md = MessageDigest.getInstance("SHA-256"); byte[] hash = md.digest(input.getBytes(java.nio.charset.StandardCharsets.UTF_8)); StringBuilder hexString = new StringBuilder(); for (byte b : hash) { String hex = Integer.toHexString(0xff & b); if (hex.length() == 1) hexString.append('0'); hexString.append(hex); } return hexString.toString(); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("SHA-256 algorithm not found", e); } } public static String evilCode(String input){ return sha256(input).substring(0, 15); } }