validator: minor.

This commit is contained in:
Christopher Jeffrey 2017-03-13 22:26:20 -07:00
parent 6eb6800fc8
commit 9a7b4eb6a0
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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');
}