Compute the `did:atomic:` identifier for a canonical base32 public key. Matches `atomic-canonical::did_for_public_key`: the fingerprint is base32 of `blake3(pubkey_bytes)`.
(canonical: &str)
| 204 | /// Matches `atomic-canonical::did_for_public_key`: the fingerprint is |
| 205 | /// base32 of `blake3(pubkey_bytes)`. |
| 206 | fn did_atomic(canonical: &str) -> String { |
| 207 | let bytes: Vec<u8> = BASE32_NOPAD |
| 208 | .decode(canonical.as_bytes()) |
| 209 | .expect("validated above"); |
| 210 | let hash = blake3::hash(&bytes); |
| 211 | format!( |
| 212 | "{DID_ATOMIC_PREFIX}{}", |
| 213 | BASE32_NOPAD.encode(hash.as_bytes()) |
| 214 | ) |
| 215 | } |
| 216 | |
| 217 | /// Truncate a base32 key for display (matches the `identity list` style). |
| 218 | fn short_key(key: &str) -> String { |