validator: minor.
This commit is contained in:
parent
6eb6800fc8
commit
9a7b4eb6a0
@ -279,9 +279,9 @@ Validator.prototype.hash = function hash(key, fallback) {
|
||||
|
||||
if (typeof value !== 'string') {
|
||||
if (!Buffer.isBuffer(value))
|
||||
throw new Error(fmt(key) + ' must be a buffer.');
|
||||
throw new Error(fmt(key) + ' must be a hash.');
|
||||
if (value.length !== 32)
|
||||
throw new Error(fmt(key) + ' must be a buffer.');
|
||||
throw new Error(fmt(key) + ' must be a hash.');
|
||||
return value.toString('hex');
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user