pub struct Des;
Expand description
Generator for DES-based tripcodes (4chan and 2channel’s 10-character tripcode) that accepts custom salt characters.
It is essentially the same as crypt(3)
, but treats invalid salt characters in 4chan and
2channel’s fashion. Invalid salt characters are reinterpreted as per the following table.
0x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
10 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
20 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | / |
30 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
40 | G | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
50 | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e |
60 | f | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o |
70 | p | q | r | s | t | u | v | w | x | y | z | . | . | . | . | . |
80 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
90 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
A0 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
B0 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
C0 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
D0 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
E0 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
F0 | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
§Reference
- https://osdn.jp/projects/naniya/wiki/2chtrip (Japanese)
Implementations§
Source§impl Des
impl Des
Sourcepub fn hash<P: AsRef<[u8]>>(password: P, salt1: u8, salt2: u8) -> FourchanHash
pub fn hash<P: AsRef<[u8]>>(password: P, salt1: u8, salt2: u8) -> FourchanHash
Generates a hash value from password
and a pair of custom salt characters.
Sourcepub fn generate<P: AsRef<[u8]>>(password: P, salt1: u8, salt2: u8) -> String
pub fn generate<P: AsRef<[u8]>>(password: P, salt1: u8, salt2: u8) -> String
Generates a tripcode from password
and a pair of custom salt characters.
Auto Trait Implementations§
impl Freeze for Des
impl RefUnwindSafe for Des
impl Send for Des
impl Sync for Des
impl Unpin for Des
impl UnwindSafe for Des
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