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

Function short_key

atomic-cli/src/commands/identity/lookup_key.rs:218–224  ·  view source on GitHub ↗

Truncate a base32 key for display (matches the `identity list` style).

(key: &str)

Source from the content-addressed store, hash-verified

216
217/// Truncate a base32 key for display (matches the `identity list` style).
218fn short_key(key: &str) -> String {
219 if key.len() > 16 {
220 format!("{}...", &key[..16])
221 } else {
222 key.to_string()
223 }
224}
225
226#[cfg(test)]
227mod tests {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected