twilight_model::util

Module image_hash

source
Expand description

Efficient parsing and storage of Discord image hashes.

In a simple implementation, Discord image hashes are stored in a std::string::String. Using an ImageHash, only 17 bytes are required to store a Discord hash.

ImageHash::parse is used to parse provided bytes, along with std::convert::TryFrom, std::str::FromStr, and serde implementations. The input is assumed to be only in ASCII format. ImageHash::bytes and ImageHash::is_animated may be used to deconstruct the hash and ImageHash::new may be used to reconstruct one.

Structs§

Enums§