From f8c3f37f0c4a886447ba42035cfefd117f90da5e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 30 Jul 2016 18:24:45 -0700 Subject: [PATCH] keypair: minor. --- lib/bcoin/keypair.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bcoin/keypair.js b/lib/bcoin/keypair.js index d995c3bf..3d87616f 100644 --- a/lib/bcoin/keypair.js +++ b/lib/bcoin/keypair.js @@ -291,7 +291,9 @@ KeyPair.prototype.fromSecret = function fromSecret(secret) { * @returns {KeyPair} */ -KeyPair.fromRaw = function fromRaw(data) { +KeyPair.fromRaw = function fromRaw(data, enc) { + if (typeof data === 'string') + data = new Buffer(data, enc); return new KeyPair().fromRaw(data); };