mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-23 09:33:20 +00:00
Preserve unchanged-file reflection after revision history pruning
This commit is contained in:
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())),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user