From 9bbc7f4bfe6d7966419e8c05d2638ea44784cec7 Mon Sep 17 00:00:00 2001 From: Joran Dirk Greef Date: Tue, 31 May 2022 16:06:48 +0200 Subject: [PATCH] Demos: Fix ProtoBeetle journal.js to use Node's crypto --- demos/protobeetle/journal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/protobeetle/journal.js b/demos/protobeetle/journal.js index d9ab405076..7ad47f57ea 100644 --- a/demos/protobeetle/journal.js +++ b/demos/protobeetle/journal.js @@ -1,6 +1,5 @@ const assert = require('assert'); - -const Crypto = require('@ronomon/crypto-async'); +const crypto = require('crypto'); const Journal = { fs: require('fs'), @@ -28,7 +27,8 @@ Journal.write = function(buffer) { assert(buffer.length > 0); self.writing = true; // Simulate CPU cost of checkum: - Crypto.hash('sha256', buffer); + crypto.createHash('sha256').update(buffer).digest(); + var bytesWritten = self.fs.writeSync( self.fd, buffer,