Skip to content

Commit

Permalink
Demos: Fix ProtoBeetle journal.js to use Node's crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
jorangreef committed May 31, 2022
1 parent 0772256 commit 9bbc7f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demos/protobeetle/journal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const assert = require('assert');

const Crypto = require('@ronomon/crypto-async');
const crypto = require('crypto');

const Journal = {
fs: require('fs'),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9bbc7f4

Please sign in to comment.