MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / short_hash_full

Function short_hash_full

atomic-cli/src/commands/rpc.rs:4280–4285  ·  view source on GitHub ↗

A wire hash in the full base32 form the local listings print (`format_hash(hash, true)`).

(hash: &Option<pb::Hash>)

Source from the content-addressed store, hash-verified

4278/// A wire hash in the full base32 form the local listings print
4279/// (`format_hash(hash, true)`).
4280fn short_hash_full(hash: &Option<pb::Hash>) -> String {
4281 hash.as_ref()
4282 .and_then(|h| h.value.clone().try_into().ok())
4283 .map(|bytes: [u8; 32]| Merkle(bytes).to_base32())
4284 .unwrap_or_else(|| "-".to_string())
4285}
4286
4287/// `atomic view split` over SplitView. Change specs and --last N resolve
4288/// through the daemon's Log RPC; --switch composes SwitchView after.

Callers 1

insert_promoteFunction · 0.85

Calls 5

MerkleClass · 0.85
as_refMethod · 0.80
okMethod · 0.45
cloneMethod · 0.45
to_base32Method · 0.45

Tested by

no test coverage detected