curveToID function

int curveToID(
  1. String curve
)

Get the ID of a given Elliptic curve @params {String} curve Elliptic curve

Implementation

int curveToID(String curve) {
  switch (curve) {
    case 'ed25519':
      return 0;
    case 'P256':
      return 1;
    case 'secp256k1':
      return 2;
    default:
      throw 'Curve not supported';
  }
}