From a08d0a5a19680cfeb5639c8857b11e4ab9533dae Mon Sep 17 00:00:00 2001 From: William Casarin Date: Mon, 31 Jul 2023 03:35:38 -0700 Subject: [PATCH] ndb: more id transition helpers --- damus/Nostr/Pubkey.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/damus/Nostr/Pubkey.swift b/damus/Nostr/Pubkey.swift index e5c90295..922eea54 100644 --- a/damus/Nostr/Pubkey.swift +++ b/damus/Nostr/Pubkey.swift @@ -12,3 +12,18 @@ typealias FollowRef = ReferencedId typealias Pubkey = String typealias NoteId = String typealias Privkey = String + +extension String { + // Id constructors + init?(hex: String) { + self = hex + } + + static var empty: String { + return "" + } + + func hex() -> String { + return self + } +}