feat: simple poc
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
pub use constants::*;
|
||||
pub use paths::*;
|
||||
pub use utils::*;
|
||||
|
||||
mod constants;
|
||||
mod paths;
|
||||
mod utils;
|
||||
|
||||
11
crates/common/src/utils.rs
Normal file
11
crates/common/src/utils.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use nostr_sdk::prelude::*;
|
||||
|
||||
pub fn shorten_pubkey(public_key: PublicKey, len: usize) -> String {
|
||||
let Ok(pubkey) = public_key.to_bech32();
|
||||
|
||||
format!(
|
||||
"{}:{}",
|
||||
&pubkey[0..(len + 1)],
|
||||
&pubkey[pubkey.len() - len..]
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user