From 7be40debe7ac78dc5650dbf5323965c9eeff119a Mon Sep 17 00:00:00 2001 From: themodrnhakr Date: Fri, 21 Mar 2025 15:40:08 -0500 Subject: [PATCH] Add cryptography module with hashing function --- src/database/crypt.jmc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/database/crypt.jmc b/src/database/crypt.jmc index e69de29..b5dd9be 100644 --- a/src/database/crypt.jmc +++ b/src/database/crypt.jmc @@ -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(); + } +}