Merge pull request #209 from indexzero/better-DX

[fix] handle buffers
This commit is contained in:
Charlie Robbins 2016-02-02 21:46:14 -08:00
commit b065c4ccd9

View file

@ -38,8 +38,8 @@ var File = exports.File = function (options) {
|| 2;
if (this.secure) {
this.secure = typeof this.secure === 'string'
? { secret: this.secure }
this.secure = Buffer.isBuffer(this.secure) || typeof this.secure === 'string'
? { secret: this.secure.toString() }
: this.secure;
this.secure.alg = this.secure.alg || 'aes-256-ctr';