use Buffer.from method as Buffer() is deprecated

use Buffer.from method as Buffer() is deprecated due to security and usability issues
pull/34/head
Wael 3 years ago committed by GitHub
parent 189bb9b037
commit 1535bab629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -95,7 +95,7 @@
}
if (Array.isArray(message) || ArrayBuffer.isView(message) ||
message.constructor === Buffer) {
return crypto.createHash(algorithm).update(new Buffer(message)).digest('hex');
return crypto.createHash(algorithm).update(new Buffer.from(message)).digest('hex');
} else {
return method(message);
}

Loading…
Cancel
Save