fromName static method

BcryptVersion fromName(
  1. String name
)

Gets the version from string name

Implementation

static BcryptVersion fromName(String name) {
  switch (name) {
    case '2a':
      return BcryptVersion.$2a;
    case '2b':
      return BcryptVersion.$2b;
    case '2x':
      return BcryptVersion.$2x;
    case '2y':
      return BcryptVersion.$2y;
    default:
      throw FormatException('Invalid version');
  }
}