Main Menu

Hashing Module

Started by Vortrex, Jan 28, 2023, 08:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vortrex

Here is a hashing module for those who want to use it for their server. Most of the functions have been lightly tested, but if you run into any issues please leave a reply on this topic.

Download:
https://github.com/VortrexFTW/mod_hashing/releases

Instructions:
Download and place the module file into your server's "modules" folder and put "<module src="mod_hashing" />" into the modules section of your server XML. Be sure to include the name of your modules folder (it's relative to the main server directory) and do **not** include an extension. It should look similar to this:
<modules>
    <module src="modules/mod_hashing" />
</modules>

JavaScript Example
let output = module.hashing.whirlpool("test string");
Lua Example:
local output = module.hashing.whirlpool("test string")
Squirrel Example:
local output = module.hashing.whirlpool("test string");
Available Functions:
string module.hashing.md5(string plainString);
string module.hashing.sha1(string plainString);
string module.hashing.sha224(string plainString);
string module.hashing.sha256(string plainString);
string module.hashing.sha384(string plainString);
string module.hashing.sha512(string plainString);
string module.hashing.ripemd128(string plainString);
string module.hashing.ripemd160(string plainString);
string module.hashing.ripemd256(string plainString);
string module.hashing.ripemd320(string plainString);
string module.hashing.whirlpool(string plainString);
string module.hashing.encodeBase64(string plainString);
string module.hashing.decodeBase64(string base64String);

Using MD5 to hash personal or security information is not recommended. It's a weak algorithm and has been cracked/exploited for a while now. It's only included in the module for legacy purposes.