Module tripcode::hash
[−]
[src]
Tools for handling lightweight hash values that can be encoded to/decoded from tripcodes.
Examples
use tripcode::TripcodeGenerator; use tripcode::hash::TripcodeHash; // Generating a hash value from a password. let hash = tripcode::Fourchan::hash(&"password"); assert_eq!(hash, tripcode::hash::FourchanHash(0xD3F6B95622CD44C0)); // Encoding the hash value into a tripcode. let tripcode = hash.encode(); assert_eq!("ozOtJW9BFA", &tripcode); // Decoding back the tripcode into a hash value. let decoded = tripcode::hash::FourchanHash::decode(&tripcode).unwrap(); assert_eq!(decoded, hash);
Reexports
pub use self::FourchanHash as Mona10Hash; |
Structs
FourchanHash |
58-bit hash value that represents a 10-character tripcode i.e. 4chan's tripcode or 2channel's 10-character tripcode (10桁トリップ). |
Mona12Hash |
72-bit hash value that represents 2channel's 12-character tripcode (12桁トリップ). |
Sc15Hash |
90-bit hash value that represents 2ch.sc's 15-character tripcode (15桁トリップ). |
ScKatakanaHash |
90-bit hash value that represents 2ch.sc's katakana tripcode (カタカナトリップ). |
Enums
MonaHash |
Hash value that represents a 2channel tripcode. |
ScHash |
Hash value that represents a 2ch.sc tripcode. |
Traits
AsciiTripcodeHash |
Trait for hash values that represent ASCII-encoded tripcodes. |
TripcodeHash |
Trait for hash values that represent tripcodes. |