Auth.hash

Pasword encoded as UTF-8 if AuthCredentials.hash is false or the hash (specified in AuthCredentials.hashAlgorithm) of the password encoded as UTF-8 concatenated with the bytes from AuthCredentials.payload if true. The hash can be done with a function (if hashAlgorithm is sha1) in D:

sha1Of(cast(ubyte[])password ~ authCredentials.payload);

Or using MessageDigest in Java:

MessageDigest md = MessageDigest.getInstance(authCredentials.hashAlgorithm);
md.update(password.getBytes(StandardCharsets.UTF_8));
md.update(authCredentials.payload);
byte[] hash = md.digest();
class Auth
ubyte[] hash;

Meta