wip: refactor

This commit is contained in:
2025-01-11 09:16:30 +07:00
parent 38d0061796
commit 08980e55a4
10 changed files with 379 additions and 428 deletions

View File

@@ -11,6 +11,11 @@ pub fn room_hash(tags: &Tags) -> u64 {
hasher.finish()
}
pub fn shorted_public_key(public_key: PublicKey) -> String {
let pk = public_key.to_string();
format!("{}:{}", &pk[0..4], &pk[pk.len() - 4..])
}
pub fn show_npub(public_key: PublicKey, len: usize) -> String {
let bech32 = public_key.to_bech32().unwrap_or_default();
let separator = " ... ";