diff --git a/radicle-crypto/src/lib.rs b/radicle-crypto/src/lib.rs index d050c757..3bb06988 100644 --- a/radicle-crypto/src/lib.rs +++ b/radicle-crypto/src/lib.rs @@ -361,6 +361,11 @@ impl PublicKey { multibase::encode(multibase::Base::Base58Btc, buf) } + + #[cfg(feature = "git-ref-format")] + pub fn to_namespace(&self) -> git_ref_format::RefString { + git_ref_format::refname!("refs/namespaces").join(git_ref_format::Component::from(self)) + } } impl FromStr for PublicKey {