* Buffer froms that should be allocs
* Remove unnecessary Buffer fill after alloc * minor cleanup on fnv1a.js
This commit is contained in:
@@ -38,7 +38,7 @@ module.exports = class FNV1a {
|
||||
|
||||
digest(encoding) {
|
||||
encoding = encoding || 'binary';
|
||||
let buf = Buffer.alloc(4);
|
||||
const buf = Buffer.alloc(4);
|
||||
buf.writeInt32BE(this.hash & 0xffffffff, 0);
|
||||
return buf.toString(encoding);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user