'use strict';
var _ = require('lodash');

var algos = {
  'eddsa': 'eddsa',
  'curve25519': 'curve25519',
  'triplesec-v3': 'triplesec-v3',
  'scrypt': 'scrypt',
  'nacl easybox': 'nacl-easybox',
  'nacl secretbox': 'nacl-secretbox',
};

algos.name = function(b) {
  b = ''+b; // coerce to string
  var found = _.findKey(algos, function(val) {
    return val === b.toLowerCase();
  });
  if (found) {
    return found;
  }

  throw new Error('unrecognized algo');
};

algos.value = function(key) {
  var algo = algos[key.toString().toLowerCase()];
  if (algo) {
    return algo;
  }

  throw new Error('unrecognized algo');
};

module.exports = algos;

@@ -174,21 +174,16 @@
 ybox': '
-nacl-
 easybox'
@@ -209,13 +209,8 @@
 ': '
-nacl-
 secr

Rename alg value for easybox/secretbox