Skip to content

A module for Garry's Mod that provides common hash functions.

License

Notifications You must be signed in to change notification settings

viral32111/hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hash

This is a module for Garry's Mod that provides a handful of common hashing and checksum functions to use on strings and files, for addon developers to use in Lua.

Even though this module is intended to be used serverside, downloads for both client and server environments are available.

NOTE: There are now native string hash functions for MD5, SHA1 and SHA256 as of the July 2021 Patch (#1077).

Documentation

To use this module in an addon, call require( "hash" ) at the beginning of the Lua file(s).

The functions this module exposes to the Lua environment are documented below.

  • TO-DO: hash.md5( string )
  • TO-DO: hash.sha1( string )
  • TO-DO: hash.sha2( string text, number bits = 256 ) (bits can be 224, 256, 384, or 512)
  • TO-DO: hash.sha3( string text, number bits = 256 ) (bits can be 224, 256, 384, or 512)
  • TO-DO: hash.blake2( string, boolean x64 = false ) (if x64 is true then BLAKE2b is used, otherwise BLAKE2s)

Building

Follow the steps documented below to build this module yourself.

  1. Download the Garry's Mod module base header files into the gmod-module-base directory at the root of the project.
  2. Download and compile Crypto++ library, then add its header and library files to the linker.
  3. Open the CMake project in your preferred IDE (e.g. Visual Studio), then build it.

License

Copyright (C) 2019-2023 viral32111.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses.

About

A module for Garry's Mod that provides common hash functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published