35 lines
1.2 KiB
Java
35 lines
1.2 KiB
Java
package me.chayapak1.chomensbot_mabe.plugins;
|
||
|
||
import lombok.Getter;
|
||
import me.chayapak1.chomensbot_mabe.Bot;
|
||
|
||
import com.google.common.hash.Hashing;
|
||
|
||
import java.nio.charset.StandardCharsets;
|
||
import java.util.concurrent.TimeUnit;
|
||
|
||
public class HashingPlugin {
|
||
@Getter private String hash;
|
||
@Getter private String ownerHash;
|
||
|
||
public HashingPlugin (Bot bot) {
|
||
|
||
bot.executor().schedule(this::update, 2, TimeUnit.SECONDS);
|
||
}
|
||
|
||
public void update () {
|
||
final String ownerHashKey = "b)R<><52>nF<6E>CW<43><57><EFBFBD>#<23>\\[<5B>S*8\"t^eia<69>Z<EFBFBD><5A>k<EFBFBD><6B><EFBFBD><EFBFBD>K1<4B>8zȢ<7A>";
|
||
final String normalHashKey = "<EFBFBD>iB_D<EFBFBD><EFBFBD><EFBFBD>k<EFBFBD><EFBFBD>j8H<EFBFBD>{?[/ڭ<>f<EFBFBD>}Ѣ<>^-=<3D>Ț<EFBFBD><C89A>v]<5D><>g><3E><>=c";
|
||
|
||
final String hashValue = System.currentTimeMillis() / 10_000 + normalHashKey;
|
||
hash = Hashing.sha256()
|
||
.hashString(hashValue, StandardCharsets.UTF_8)
|
||
.toString().substring(0, 16);
|
||
|
||
final String ownerHashValue = System.currentTimeMillis() / 10_000 + ownerHashKey;
|
||
ownerHash = Hashing.sha256()
|
||
.hashString(ownerHashValue, StandardCharsets.UTF_8)
|
||
.toString().substring(0, 16);
|
||
}
|
||
}
|