mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 19:20:41 +02:00
Fix Node.js 10 deprecation warnings
This commit is contained in:
parent
476e8f2f0c
commit
f16eb6f3e6
12 changed files with 42 additions and 41 deletions
|
@ -19,7 +19,7 @@ module.exports = class FNV1a {
|
|||
}
|
||||
|
||||
if(_.isString(data)) {
|
||||
data = new Buffer(data);
|
||||
data = Buffer.from(data);
|
||||
}
|
||||
|
||||
if(!Buffer.isBuffer(data)) {
|
||||
|
@ -38,7 +38,7 @@ module.exports = class FNV1a {
|
|||
|
||||
digest(encoding) {
|
||||
encoding = encoding || 'binary';
|
||||
let buf = new Buffer(4);
|
||||
let buf = Buffer.alloc(4);
|
||||
buf.writeInt32BE(this.hash & 0xffffffff, 0);
|
||||
return buf.toString(encoding);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue