mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-21 05:15:17 +02:00
fix deprecated warnings on Buffer class (#580)
Signed-off-by: Denis barbaron <denis.barbaron@orange.com> Signed-off-by: Denis barbaron <denis.barbaron@orange.com>
This commit is contained in:
@@ -7,7 +7,7 @@ function reverseByteBits(b) {
|
||||
}
|
||||
|
||||
function reverseBufferByteBits(b) {
|
||||
var result = new Buffer(b.length)
|
||||
var result = Buffer.alloc(b.length)
|
||||
|
||||
for (var i = 0; i < result.length; ++i) {
|
||||
result[i] = reverseByteBits(b[i])
|
||||
@@ -17,7 +17,7 @@ function reverseBufferByteBits(b) {
|
||||
}
|
||||
|
||||
function normalizePassword(password) {
|
||||
var key = new Buffer(8).fill(0)
|
||||
var key = Buffer.alloc(8).fill(0)
|
||||
|
||||
// Make sure the key is always 8 bytes long. VNC passwords cannot be
|
||||
// longer than 8 bytes. Shorter passwords are padded with zeroes.
|
||||
@@ -28,7 +28,7 @@ function normalizePassword(password) {
|
||||
|
||||
function encrypt(challenge, password) {
|
||||
var key = normalizePassword(password)
|
||||
var iv = new Buffer(0).fill(0)
|
||||
var iv = Buffer.alloc(0).fill(0)
|
||||
|
||||
// Note: do not call .final(), .update() is the one that gives us the
|
||||
// desired result.
|
||||
|
||||
Reference in New Issue
Block a user