Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
crypto: add PublicKey::to_namespace
Fintan Halpenny committed 3 years ago
commit d73d48584846f445c60c7370a15f7dd89ba2801e
parent 91efbd9630dce10517f189f33b6533a70d45cdbf
1 file changed +5 -0
modified 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 {