Preserve unchanged-file reflection after revision history pruning

This commit is contained in:
vorotamoroz committed 2026-10-17 13:24:53 +00:00
1 parent 72dc88c7ef
commit f47db4f256
19 files changed
+524 -18

No files matched your search

@@ -0,0 +1,20 @@
import { computeFileContentHash } from "@vrtmrz/livesync-commonlib/hashing";
import { xxhashNew } from "octagonal-wheels/hash/xxhash.js";
import {
createFixedFileContentHashInput,
type FileContentHashBenchmarkOperations,
} from "./reviewHarnessFileContentHashBenchmark";
export async function createFileContentHashBenchmarkOperations(
clock: Pick<Performance, "now"> = performance
): Promise<FileContentHashBenchmarkOperations> {
const started = clock.now();
const xxHash = await xxhashNew();
const xxHashInitialisationMs = clock.now() - started;
return {
xxHashInitialisationMs,
createInput: createFixedFileContentHashInput,
sha256: (content) => computeFileContentHash(content),
xxHash64: async (content) => xxHash.h64Raw(new Uint8Array(await content.arrayBuffer())),
};
}