From ec6302c3e23e43823406e8834712049551615ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20Vrzi=C4=87?= Date: Fri, 24 Feb 2023 18:14:55 +0100 Subject: [PATCH] Improved formatting --- tests/blake2worker.js | 10 +++++----- tests/worker/blake2hash-worker.js | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/blake2worker.js b/tests/blake2worker.js index 5b58bb1..fe60b87 100644 --- a/tests/blake2worker.js +++ b/tests/blake2worker.js @@ -12,13 +12,13 @@ function newWorker (data) { workerData: { data: data }, - }); - worker.on('message', (hash) => { + }); + worker.on('message', (hash) => { resolve(hash); - }); - worker.on('error', (msg) => { + }); + worker.on('error', (msg) => { reject(msg); - }); + }); }); } diff --git a/tests/worker/blake2hash-worker.js b/tests/worker/blake2hash-worker.js index 99bf108..3dfbbc8 100644 --- a/tests/worker/blake2hash-worker.js +++ b/tests/worker/blake2hash-worker.js @@ -1,7 +1,8 @@ 'use strict'; + const blake2 = require('../../index.js'); const {workerData, parentPort} = require('worker_threads'); -const blake2Hash = (data) => { +const blake2Hash = data => { const context = blake2.createHash('blake2b'); context.update(Buffer.from(data)); const hash = context.digest('hex');