Browse Source

Remove DEP0005 warning from use of the Buffer object

Godzil 5 years ago
parent
commit
2e294c841a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/subtitle/decode.ts

+ 1 - 1
src/subtitle/decode.ts

@@ -53,7 +53,7 @@ function decompress(data: Buffer, done: (err: Error, result?: Buffer) => void)
 function key(subtitleId: number): Buffer
 {
   const hash = secret(20, 97, 1, 2) + magic(subtitleId);
-  const result = new Buffer(32);
+  const result = Buffer.allocUnsafe(32);
 
   result.fill(0);
   crypto.createHash('sha1').update(hash).digest().copy(result);