Add cryptography module with hashing function
All checks were successful
Deploy datapack to dev / Build (push) Successful in 9s
All checks were successful
Deploy datapack to dev / Build (push) Successful in 9s
This commit is contained in:
parent
a4e515ed80
commit
7be40debe7
@ -0,0 +1,17 @@
|
|||||||
|
class database.crypt {
|
||||||
|
function hashString() {}
|
||||||
|
|
||||||
|
function hashInteger() {
|
||||||
|
$cryptMultiplyer = 49;
|
||||||
|
$cryptConstant = 7;
|
||||||
|
$cryptPrime = 15331;
|
||||||
|
|
||||||
|
$$input = $(integer);
|
||||||
|
$hash = $input;
|
||||||
|
$hash *= $cryptMultiplyer;
|
||||||
|
$hash += $cryptConstant;
|
||||||
|
$hash %= $cryptPrime;
|
||||||
|
|
||||||
|
tellraw @a $hash.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user