idToHashAlgo function

String idToHashAlgo(
  1. int id
)

Get the hash algo name from the hash algorithm ID.

Implementation

String idToHashAlgo(int id) {
  switch (id) {
    case 0:
      return 'sha256';
    case 1:
      return 'sha512';
    case 2:
      return 'sha3-256';
    case 3:
      return 'sha3-512';
    case 4:
      return 'blake2b';
    default:
      throw 'Hash algorithm ID not supported';
  }
}