feat: add prometheus plugin scaffold
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.prometheus.spigot.util;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Base64;
|
||||
|
||||
public final class TokenGenerator {
|
||||
private static final SecureRandom RANDOM = new SecureRandom();
|
||||
private static final Base64.Encoder ENCODER = Base64.getUrlEncoder().withoutPadding();
|
||||
|
||||
private TokenGenerator() {
|
||||
}
|
||||
|
||||
public static String generate() {
|
||||
byte[] bytes = new byte[32];
|
||||
RANDOM.nextBytes(bytes);
|
||||
return ENCODER.encodeToString(bytes);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user