From c15960fd59e095b34f6aa77949e68dcc2a26f723 Mon Sep 17 00:00:00 2001 From: Herb Caudill Date: Mon, 4 Dec 2023 12:11:58 +0100 Subject: [PATCH] whitespace --- packages/automerge-repo/src/network/NetworkAdapter.ts | 5 +---- packages/automerge-repo/src/storage/keyHash.ts | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/automerge-repo/src/network/NetworkAdapter.ts b/packages/automerge-repo/src/network/NetworkAdapter.ts index 80908f89c..e95a08656 100644 --- a/packages/automerge-repo/src/network/NetworkAdapter.ts +++ b/packages/automerge-repo/src/network/NetworkAdapter.ts @@ -30,10 +30,7 @@ export abstract class NetworkAdapter extends EventEmitter * @argument peerId - the peerId of this repo * @argument peerMetadata - how this adapter should present itself to other peers */ - abstract connect( - peerId: PeerId, - peerMetadata?: PeerMetadata - ): void + abstract connect(peerId: PeerId, peerMetadata?: PeerMetadata): void /** Called by the {@link Repo} to send a message to a peer * diff --git a/packages/automerge-repo/src/storage/keyHash.ts b/packages/automerge-repo/src/storage/keyHash.ts index b35ec5ac1..fa8cdf618 100644 --- a/packages/automerge-repo/src/storage/keyHash.ts +++ b/packages/automerge-repo/src/storage/keyHash.ts @@ -7,11 +7,13 @@ export function keyHash(binary: Uint8Array) { const hash = sha256.hash(binary) return bufferToHexString(hash) } + export function headsHash(heads: A.Heads): string { const encoder = new TextEncoder() const headsbinary = mergeArrays(heads.map((h: string) => encoder.encode(h))) return keyHash(headsbinary) } + function bufferToHexString(data: Uint8Array) { return Array.from(data, byte => byte.toString(16).padStart(2, "0")).join("") }