Skip to content

Commit

Permalink
nostr: add to_bytes method to EventId
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Oct 26, 2023
1 parent aab5cb1 commit 6a2f44e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/nostr/src/event/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ impl EventId {
self.as_ref()
}

/// Consume and get bytes
pub fn to_bytes(self) -> [u8; 32] {
self.0.to_byte_array()
}

/// Get as hex string
pub fn to_hex(&self) -> String {
self.0.to_string()
Expand Down

0 comments on commit 6a2f44e

Please sign in to comment.