载入中...
搜索中...
未找到
SnapshotHash.cpp
浏览该文件的文档.
40 right = (right ^ (static_cast<std::uint64_t>(byte) + 0x9e3779b97f4a7c15ull)) * 14029467366897019727ull;
55 static std::shared_ptr<ISnapshotContentHasher> value = std::make_shared<BuiltinSnapshotContentHasher>();
61 if (ISnapshotContentHasher* registered = registeredSnapshotContentHasher(); registered != nullptr) {
79std::shared_ptr<ISnapshotContentHasher> builtinSnapshotContentHasher() { return builtinHolder(); }
94 return [hasher](std::string_view canonicalInput) -> Result<ContentId> { return hasher->hash(canonicalInput); };
Stable, structured diagnostics shared by engine modules.
Injectable content-digest provider for snapshots, with an honest default.
One content-digest implementation usable for snapshot sealing and verification.
Definition SnapshotHash.h:54
virtual std::string_view id() const noexcept=0
Stable algorithm id, persisted or logged next to the data it hashed.
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
@ NoOp
@ Applied
std::string_view contentDigestKindName(ContentDigestKind kind) noexcept
Stable protocol spelling of a digest kind.
Definition SnapshotHash.cpp:71
ContentDigestKind
What a digest implementation actually guarantees, stated rather than implied.
Definition SnapshotHash.h:38
@ Cryptographic
A cryptographic digest; the provider documents its algorithm and properties.
@ NonCryptographic
Fast, deterministic, collision-resistant enough for storage identity only.
Result< void > registerBuiltinSnapshotHasher()
Register the built-in hasher, unless a module already registered one.
Definition SnapshotHash.cpp:85
StrongUuid< detail::ContentIdTag > ContentId
Deterministic identity of equivalent canonical content.
Definition Identity.h:264
SnapshotHashProvider snapshotContentHashProvider()
A SnapshotHashProvider backed by the active hasher.
Definition SnapshotHash.cpp:92
std::shared_ptr< ISnapshotContentHasher > builtinSnapshotContentHasher()
The engine's built-in content hasher.
Definition SnapshotHash.cpp:79
std::string_view activeSnapshotHashAlgorithm() noexcept
Id of the algorithm snapshotContentHashProvider currently uses.
Definition SnapshotHash.cpp:97
ISnapshotContentHasher * registeredSnapshotContentHasher() noexcept
The currently registered hasher, if a module registered one.
Definition SnapshotHash.cpp:81
std::function< Result< ContentId >(std::string_view canonicalInput)> SnapshotHashProvider
Injected content-digest implementation used by snapshots.
Definition Snapshot.h:36