getDigest method Null safety

Digest getDigest(
  1. HashAlgorithm digestAlgorithm
)

Implementation

Digest getDigest(HashAlgorithm digestAlgorithm) {
  switch (digestAlgorithm) {
    case HashAlgorithm.sha1:
      return SHA1Digest();
    case HashAlgorithm.sha256:
      return SHA256Digest();
    case HashAlgorithm.sha384:
      return SHA384Digest();
    case HashAlgorithm.sha512:
      return SHA512Digest();
  }
}