public final class PasswordEncoder extends Object
PasswordEncoder encoder = new PasswordEncoder("my connection key");
encoder.encode("my password"); // Encode password for send to the server
encoder.decode(encodedPassword); // Decode the password
https://github.com/Emudofus/Dofus/blob/1.29/ank/utils/Crypt.as#L20| Constructor and Description |
|---|
PasswordEncoder(String key) |
| Modifier and Type | Method and Description |
|---|---|
String |
decode(String encoded)
Decode given string using key
|
String |
encode(String password)
Encode the password using the key
|
String |
key()
Get the encoding key
|
public PasswordEncoder(String key)
key - The key to use. It must be long enough to encode the password.@Pure public String key()
@SideEffectFree public String decode(String encoded)
encoded - Encoded stringIllegalArgumentException - When the encoded string is invalid, or the key is too small@SideEffectFree public String encode(String password)
password - The raw passwordIllegalArgumentException - When the password is too longCopyright © 2022. All rights reserved.