commit a08d0a5a19680cfeb5639c8857b11e4ab9533dae parent ff20cc4767b1c2f0118a30851e78299f7be21755 Author: William Casarin <jb55@jb55.com> Date: Mon, 31 Jul 2023 03:35:38 -0700 ndb: more id transition helpers Diffstat:
M | damus/Nostr/Pubkey.swift | | | 15 | +++++++++++++++ |
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git 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 + } +}