net.minestom.server.crypto.SaltSignaturePair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.crypto;
import net.minestom.server.network.NetworkBuffer;
import org.jetbrains.annotations.NotNull;
import static net.minestom.server.network.NetworkBuffer.BYTE_ARRAY;
import static net.minestom.server.network.NetworkBuffer.LONG;
public record SaltSignaturePair(long salt, byte[] signature) implements NetworkBuffer.Writer {
public SaltSignaturePair(@NotNull NetworkBuffer reader) {
this(reader.read(LONG), reader.read(BYTE_ARRAY));
}
@Override
public void write(@NotNull NetworkBuffer writer) {
writer.write(LONG, salt);
writer.write(BYTE_ARRAY, signature);
}
}