@Test public void testSHA512() { eq(Crypto.sha512("abc"), "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"); eq(Crypto.sha512("x"), "a4abd4448c49562d828115d13a1fccea927f52b4d5459297f8b43e42da89238bc13626e43dcb38ddb082488927ec904fb42057443983e88585179d50551afe62"); eq(Crypto.sha512(" "), "f90ddd77e400dfe6a3fcf479b00b1ee29e7015c5bb8cd70f5f15b4886cc339275ff553fc8a053f8ddc7324f45168cffaf81f8c3ac93996f6536eef38e5e40768"); eq(Crypto.sha512(""), "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"); }
public static String sha512(byte[] bytes) { return bytesAsText(sha512Bytes(bytes)); }
Crypto extends RapidoidThing { public static String sha512(byte[] bytes) { return bytesAsText(sha512Bytes(bytes)); } }
Crypto extends RapidoidThing { public static String sha512(byte[] bytes) { return bytesAsText(sha512Bytes(bytes)); }  }
Crypto extends RapidoidThing { public static String sha512(byte[] bytes) { return bytesAsText(sha512Bytes(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 sha512(byte[] bytes) { return bytesAsText(sha512Bytes(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; }