@Test public void testMD5() { eq(Crypto.md5("abc"), "900150983cd24fb0d6963f7d28e17f72"); eq(Crypto.md5("x"), "9dd4e461268c8034f5c8564e155c67a6"); eq(Crypto.md5(" "), "7215ee9c7d9dc229d2921a40e899ec5f"); eq(Crypto.md5(""), "d41d8cd98f00b204e9800998ecf8427e"); }
public static String md5(byte[] bytes) { return bytesAsText(md5Bytes(bytes)); }
Crypto extends RapidoidThing { public static String md5(byte[] bytes) { return bytesAsText(md5Bytes(bytes)); } }
Crypto extends RapidoidThing { public static String md5(byte[] bytes) { return bytesAsText(md5Bytes(bytes)); }  }
Crypto extends RapidoidThing { public static String md5(byte[] bytes) { return bytesAsText(md5Bytes(bytes)); }  static void reset(); static MessageDigest digest(String algorithm); static Cipher cipher(String transformation); static String bytesAsText(byte[] bytes); static byte[] md5Bytes(byte[] bytes); static String md5(byte[] bytes); static String md5(String data); static byte[] sha1Bytes(byte[] bytes); static String sha1(byte[] bytes); static String sha1(String data); static byte[] sha512Bytes(byte[] bytes); static String sha512(byte[] bytes); static String sha512(String data); static synchronized CryptoKey getSecretKey(); static String randomStr(int byteCount); static byte[] encrypt(byte[] data, CryptoKey key); static byte[] decrypt(byte[] data, CryptoKey key); static byte[] encrypt(byte[] data); static byte[] decrypt(byte[] data); static byte[] pbkdf2(char[] password, byte[] salt, int iterations, int length); static String passwordHash(char[] password); static String passwordHash(char[] password, int iterations); static String passwordHash(char[] password, int iterations, byte[] salt); static boolean passwordMatches(char[] password, String saltedHash); static boolean passwordMatches(String password, String saltedHash); static byte[] randomBytes(int byteCount); static byte[] hmac(byte[] data, byte[] secret, byte[] salt); static boolean hmacMatches(byte[] hmac, byte[] data, byte[] secret, byte[] salt); }
Crypto extends RapidoidThing { public static String md5(byte[] bytes) { return bytesAsText(md5Bytes(bytes)); }  static void reset(); static MessageDigest digest(String algorithm); static Cipher cipher(String transformation); static String bytesAsText(byte[] bytes); static byte[] md5Bytes(byte[] bytes); static String md5(byte[] bytes); static String md5(String data); static byte[] sha1Bytes(byte[] bytes); static String sha1(byte[] bytes); static String sha1(String data); static byte[] sha512Bytes(byte[] bytes); static String sha512(byte[] bytes); static String sha512(String data); static synchronized CryptoKey getSecretKey(); static String randomStr(int byteCount); static byte[] encrypt(byte[] data, CryptoKey key); static byte[] decrypt(byte[] data, CryptoKey key); static byte[] encrypt(byte[] data); static byte[] decrypt(byte[] data); static byte[] pbkdf2(char[] password, byte[] salt, int iterations, int length); static String passwordHash(char[] password); static String passwordHash(char[] password, int iterations); static String passwordHash(char[] password, int iterations, byte[] salt); static boolean passwordMatches(char[] password, String saltedHash); static boolean passwordMatches(String password, String saltedHash); static byte[] randomBytes(int byteCount); static byte[] hmac(byte[] data, byte[] secret, byte[] salt); static boolean hmacMatches(byte[] hmac, byte[] data, byte[] secret, byte[] salt); static final SecureRandom RANDOM; }