getAlgorithm static method Null safety

Hash getAlgorithm(
  1. Algorithm algorithm
)

Gets the Mac for the provided algorithm. Mostly used for testing, not very helpful outside of that.

Implementation

static Hash getAlgorithm(Algorithm algorithm) {
  switch (algorithm) {
    case Algorithm.SHA256:
      return sha256;
    case Algorithm.SHA512:
      return sha512;
    case Algorithm.SHA1:
      return sha1;
    default:
      return sha256;
  }
}