pub struct UrlHash;Expand description
URL hashing utilities that match TypeScript SDK
Implementations§
Source§impl UrlHash
impl UrlHash
Sourcepub fn hash_url(url: &str) -> [u8; 32]
pub fn hash_url(url: &str) -> [u8; 32]
Hash an Accumulate URL for identity derivation Matches TS: hashUrl(url: string): Uint8Array
Sourcepub fn hash_url_hex(url: &str) -> String
pub fn hash_url_hex(url: &str) -> String
Hash an Accumulate URL, returning hex string Matches TS: hashUrl(url: string): string (when hex output requested)
Sourcepub fn normalize_url(url: &str) -> String
pub fn normalize_url(url: &str) -> String
Normalize Accumulate URL for consistent hashing Matches TS URL normalization rules
Sourcepub fn derive_key_book_url(identity_url: &str) -> String
pub fn derive_key_book_url(identity_url: &str) -> String
Derive key book URL from identity URL Matches TS: deriveKeyBookUrl(identityUrl: string): string
Sourcepub fn derive_key_page_url(key_book_url: &str, page_index: u32) -> String
pub fn derive_key_page_url(key_book_url: &str, page_index: u32) -> String
Derive key page URL from key book URL and page index Matches TS: deriveKeyPageUrl(keyBookUrl: string, pageIndex: number): string
Extract authority from Accumulate URL Matches TS: extractAuthority(url: string): string
Sourcepub fn extract_path(url: &str) -> String
pub fn extract_path(url: &str) -> String
Extract path from Accumulate URL Matches TS: extractPath(url: string): string
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UrlHash
impl RefUnwindSafe for UrlHash
impl Send for UrlHash
impl Sync for UrlHash
impl Unpin for UrlHash
impl UnsafeUnpin for UrlHash
impl UnwindSafe for UrlHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more