types: Expected Buffer, length to follow
This commit is contained in:
parent
bfb7289cf2
commit
ca4debd92e
1 changed files with 1 additions and 1 deletions
|
@ -3,7 +3,7 @@ var ecurve = require('ecurve')
|
|||
var typeforce = require('typeforce')
|
||||
|
||||
function nBuffer (value, n) {
|
||||
if (!Buffer.isBuffer(value)) return false
|
||||
typeforce(types.Buffer, value)
|
||||
if (value.length !== n) throw new Error('Expected ' + (n * 8) + '-bit Buffer, got ' + (value.length * 8) + '-bit Buffer')
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue