Can get room avatar

This commit is contained in:
2025-11-21 15:43:15 +01:00
parent ecbe4885c1
commit e8ce97eea0
8 changed files with 112 additions and 3 deletions

View File

@@ -1,6 +1,11 @@
use sha2::{Digest, Sha256};
use sha2::{Digest, Sha256, Sha512};
/// Compute SHA256sum of a given string
pub fn sha256str(input: &str) -> String {
hex::encode(Sha256::digest(input.as_bytes()))
}
/// Compute SHA256sum of a given byte array
pub fn sha512(input: &[u8]) -> String {
hex::encode(Sha512::digest(input))
}