All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.crypto.SaltSignaturePair Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy