public static HashAlgorithm getHashAlgorithm ( String hashAlgorithm ) { if ( hashAlgorithm == null ) { return null ; } switch ( hashAlgorithm ) { case "md2" : return HashAlgorithm . md2 ; case "md4" : return HashAlgorithm . md4 ; case "md5" : return HashAlgorithm . md5 ; case "none" : return HashAlgorithm . none ; case "ripemd128" : return HashAlgorithm . ripemd128 ; case "ripemd160" : return HashAlgorithm . ripemd160 ; case "sha1" : return HashAlgorithm . sha1 ; case "sha224" : return HashAlgorithm . sha224 ; case "sha256" : return HashAlgorithm . sha256 ; case "sha384" : return HashAlgorithm . sha384 ; case "sha512" : return HashAlgorithm . sha512 ; case "whirlpool" : return HashAlgorithm . whirlpool ; default : LOG . error ( "Uknown hash algorithm: \"" + hashAlgorithm + "\"" ) ; break ; } return null ; }
Returns the HashAlgorithm object matching the String .