code: func ValidateHashAlgo(h api.HashAlgo) error {
  	switch {
  	case h == api.HashAlgo_HASH_ALGO_UNSPECIFIED:
  		return errors.Reason("the hash algorithm is not specified or unrecognized").
  			Tag(grpcutil.InvalidArgumentTag).Err()
  	case int(h) >= len(supportedAlgos) || supportedAlgos[h].hash == nil:
  		return errors.Reason("unsupported hash algorithm %d", h).
  			Tag(grpcutil.InvalidArgumentTag).Err()
  	}
  	return nil
  }
docs: // ValidateHashAlgo returns a grpc-annotated error if the given algo is invalid,
  // e.g. either unspecified or not known to the current version of the code.
  //
  // Errors have InvalidArgument grpc code.