ps_hash/methods/
to_string.rs

1use ps_base64::encode;
2
3use crate::Hash;
4
5impl Hash {
6    #[must_use]
7    #[allow(clippy::inherent_to_string_shadow_display)]
8    /// Returns the base64-encoded representation of this [`Hash`].
9    ///
10    /// This method uses a single allocation,
11    /// avoiding the potential reallocations of `Display`.
12    pub fn to_string(&self) -> String {
13        encode(&self.inner)
14    }
15}