mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Add "Clone" button to projects
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
+7
-2
@@ -197,8 +197,13 @@ export function formatRadicleId(hash: Uint8Array): string {
|
||||
}
|
||||
|
||||
// Parse a Radicle Id (URN).
|
||||
export function parseRadicleId(urn: string): Uint8Array {
|
||||
const encoded = urn.replace(/^rad:[a-z]+:/, "");
|
||||
export function parseRadicleId(urn: string): string {
|
||||
return urn.replace(/^rad:[a-z]+:/, "");
|
||||
}
|
||||
|
||||
// Decode a Radicle Id (URN).
|
||||
export function decodeRadicleId(urn: string): Uint8Array {
|
||||
const encoded = parseRadicleId(urn);
|
||||
const multihash = multibase.decode(encoded);
|
||||
const hash = multihashes.decode(multihash);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user