GSM - The Ultimate Developer Library

GSuperModule (or GSM for short) is an automatically updating module full of useful libraries that developers can use. Here is an realistic example of how and when to use it:

--This showcase of GSM will do the following:
  --Encode / decode a table including a part and output a percise time.
  --Check that the decoded result is equal to the original.

GSM = require(game.ServerStorage.GSM) --or wherever you keep it
local test_input = {"bell",[55]={Instance.new("Part")},toby=44}

local QT = GSM.QT() --Benefit: no e in small times
local serialized = GSM.VS.encode64(test_input)
local deserialized = GSM.VS.decode64(serialized)
print("Encoding/decoding took", QT()) --I get about 0.0002 seconds

print(serialized, #serialized) --Only 41 characters, insane.
print(GSM.DataTypes.Table.Equal(deserialized,test_input))

GSM (Comes with formatting for editor, suggested to re-insert it occasionally to get latest formatting)

If anyone has any requests for libraries that I should add or problems with the module then please tell me.

Latest update: v1.2 [Post]

4 Likes

So are the modules provided in this loader yours? If not, you should specify which aren’t and provide credit and/or licenses.

4 Likes

At the top of the main module I have it said,

--[[Developed by Gooncreeper,
	All children of this script are created by Gooncreeper except;
			Loadstring
]]

And in the Loadstring library at the top it says

--[[
	Credit to einsteinK.
	Credit to Stravant for LBI.
	
	Credit to the creators of all the other modules used in this.
	
	Sceleratis was here and decided modify some things.
	
	einsteinK was here again to fix a bug in LBI for if-statements
--]]

But, all the other modules are written by me.

Edit:
At the top of the GSuperModule module I added

--It is recommended to look at this module if you don't know how a function works or want to see credetation of the modules.

Update:

New library called Value Serializer (pretty cool)
New and imrpoved way to use DataReader
Improved perforamance of StringCompression

An update:
I have been working on it occasionally and many new things have been added, I will only list the big cool things.

  • New API interface, instead of using the old :GetLibrary() function you can now access the libraries simply if GSM was a table (look at the updated example for more information)
  • Ease of use, your editor will now give suggestions after you insert GSM and require it instead of directly requiring GSM.
  • VS - Value Serializer. This is an amazing serializer for almost everything, ranging from support for mixed tables, to support of instances (credits to RBLXSerialize). Use .encode & .decode to use the library (note if you want the Base64 variant to save data then use .encode64 & .decode64).
  • Base64 module by myself.
  • Amazing lzw compression module by Rochet2.
  • Lightning fast hash library by Egor Skriptunoff, boatbomber, and howmanysmall.

That was not my accreditation, that was the accreditation found in the original, unmodified, loadstring library that I ported to GSM.

This is cool! I have a question? Would using a variation of the example code would you be able to use this to DataStore a table of Instances using the encode function and then load it using the decode function?

That would defiantly work, just be careful and make sure to use encode64 and decode64 for datastores.
If you have any questions or it isn’t working I can help you further if you want.

1 Like

so this takes a table of varying data types and converts it to a string?

This module contains many different libraries, the VS library (as shown in the example) does have a function for that.

Note: There are many other cool libraries in GSM besides the VS library, it was just used as an example.