isHash function

bool isHash(
  1. String input,
  2. String algorithmName
)

check if the string input is a hash available algoritms for string algorithmName param md5 md4 sha1 sha256 sha384 sha512 ripemd128 ripemd160 tiger128 tiger160 tiger192 crc32 crc32b

Implementation

bool isHash(String input, String algorithmName) {
  return RegExp("^[a-fA-F0-9]{${_lengths[algorithmName]}}\$").hasMatch(input);
}