are you trolling? its 7am good night
Why do you need to encrypt your data in the first place? Clients cannot modify server values, and the whole encryption algorithm can be bypassed completely by anyone who actually knows how to hook functions.
If you have sensitive data that you donât want your clients to see, store them on the server only.
Okay now you are arguing specific use case examples I said after I explained my own speicific use case and its works fine. It simplifies the structure of the data so that it can easily be kept. Table is now string string is now value value is stored to array use case and function
I just donât see any point in your functions, since HttpService:JSONEncode()
exists, and you can store tables in DataStores since itâs all converted to JSON anyway.
Also, since youâre not youâre not escaping characters, itâs not possible to use :
and ;
in keys or values, and you canât have nested tables.
You cannot have : or ; in strings?First it deconstructs this table
{
["Amulet"] = "Gold Bell",
["AmuletRender"] = true,
["Armor"] = "",
["ArmorRender"] = true,
["Aura"] = "",
["BackAccessory"] = "",
["BodyDepthScale"] = 1,
["BodyHeightScale"] = 1,
["BodyProportionScale"] = 1,
["BodyTypeScale"] = 1,
["BodyWidthScale"] = 1,
["Book"] = "Tome of Inferno",
["BootRender"] = false,
["Boots"] = "",
["Bracelet"] = "",
["Cape"] = "Cape of Cheer",
["CapeRender"] = true,
["Character"] = 20,
["CombatArmor"] = false,
["Constitution"] = 0,
["CustomCharacter"] = "",
["Face"] = "",
["FaceAccessory"] = "",
["Form"] = 0,
["Gender"] = false,
["Gun"] = "",
["HairAccessory"] = "",
["Hat"] = "",
["Head"] = "",
["HeadScale"] = 1,
["Helmet"] = "Light Deus Halo",
["ID1"] = "Ghost",
["ID10"] = "",
["ID11"] = "",
["ID12"] = "",
["ID13"] = "",
["ID14"] = "",
["ID15"] = "",
["ID16"] = "",
["ID17"] = "",
["ID18"] = "",
["ID19"] = "",
["ID2"] = "No",
["ID20"] = "",
["ID21"] = "",
["ID22"] = "",
["ID23"] = "",
["ID24"] = "",
["ID25"] = "",
["ID26"] = "",
["ID27"] = "",
["ID28"] = "",
["ID29"] = "",
["ID3"] = "",
["ID30"] = "",
["ID31"] = "",
["ID32"] = "",
["ID33"] = "",
["ID34"] = "",
["ID35"] = "",
["ID36"] = "",
["ID37"] = "",
["ID38"] = "",
["ID39"] = "",
["ID4"] = "",
["ID40"] = "",
["ID41"] = "",
["ID42"] = "",
["ID5"] = "",
["ID6"] = "",
["ID7"] = "",
["ID8"] = "",
["ID9"] = "",
["LeftArm"] = "",
["LeftLeg"] = "",
["MageArmor"] = "",
["Magic"] = 0,
["MeleeArmor"] = "",
["PantSkirtDress"] = "",
["Priority"] = "",
["Range"] = 0,
["RangeArmor"] = "",
["RightArm"] = "",
["RightLeg"] = "",
["Shield"] = "OrangeShield",
["SkinColor"] = "0, 0, 0",
["Strength"] = 0,
["Sword"] = "",
["TopClothes"] = "",
["Torso"] = "",
["Wand"] = "LightningWand"
}
then here is a copy of the string it makes
BodyDepthScale:1;ID21:;Range:0;RangeArmor:;ID26:;Boots:;ID37:;AmuletRender:true;ID42:;ID12:;Form:0;Strength:0;ID24:;ID22:;ID35:;ID17:;MeleeArmor:;ID19:;ID27:;ID33:;ID5:;BodyTypeScale:1;ID15:;ID29:;ArmorRender:true;ID6:;ID1:Ghost;ID41:;ID40:;ID36:;ID28:;ID10:;Book:Tome of Inferno;BootRender:false;CustomCharacter:;BodyWidthScale:1;ID34:;ID16:;ID30:;FaceAccessory:;Priority:;Constitution:0;Sword:;Character:20;RightLeg:;Amulet:Gold Bell;LeftLeg:;Torso:;TopClothes:;HairAccessory:;BodyProportionScale:1;RightArm:;CapeRender:true;Gender:false;LeftArm:;Hat:;SkinColor:0, 0, 0;ID4:;PantSkirtDress:;HeadScale:1;Armor:;ID25:;Helmet:Light Deus Halo;Face:;CombatArmor:false;Magic:0;BodyHeightScale:1;ID32:;BackAccessory:;Head:;Aura:;ID8:;Gun:;MageArmor:;Wand:LightningWand;Bracelet:;ID39:;Cape:Cape of Cheer;ID14:;ID13:;ID7:;ID2:No;ID31:;Shield:OrangeShield;ID18:;ID23:;ID38:;ID20:;ID9:;ID11:;ID3:;
then here is the table it reconstructs
{
["Amulet"] = "Gold Bell",
["AmuletRender"] = true,
["Armor"] = "",
["ArmorRender"] = true,
["Aura"] = "",
["BackAccessory"] = "",
["BodyDepthScale"] = 1,
["BodyHeightScale"] = 1,
["BodyProportionScale"] = 1,
["BodyTypeScale"] = 1,
["BodyWidthScale"] = 1,
["Book"] = "Tome of Inferno",
["BootRender"] = false,
["Boots"] = "",
["Bracelet"] = "",
["Cape"] = "Cape of Cheer",
["CapeRender"] = true,
["Character"] = 20,
["CombatArmor"] = false,
["Constitution"] = 0,
["CustomCharacter"] = "",
["Face"] = "",
["FaceAccessory"] = "",
["Form"] = 0,
["Gender"] = false,
["Gun"] = "",
["HairAccessory"] = "",
["Hat"] = "",
["Head"] = "",
["HeadScale"] = 1,
["Helmet"] = "Light Deus Halo",
["ID1"] = "Ghost",
["ID10"] = "",
["ID11"] = "",
["ID12"] = "",
["ID13"] = "",
["ID14"] = "",
["ID15"] = "",
["ID16"] = "",
["ID17"] = "",
["ID18"] = "",
["ID19"] = "",
["ID2"] = "No",
["ID20"] = "",
["ID21"] = "",
["ID22"] = "",
["ID23"] = "",
["ID24"] = "",
["ID25"] = "",
["ID26"] = "",
["ID27"] = "",
["ID28"] = "",
["ID29"] = "",
["ID3"] = "",
["ID30"] = "",
["ID31"] = "",
["ID32"] = "",
["ID33"] = "",
["ID34"] = "",
["ID35"] = "",
["ID36"] = "",
["ID37"] = "",
["ID38"] = "",
["ID39"] = "",
["ID4"] = "",
["ID40"] = "",
["ID41"] = "",
["ID42"] = "",
["ID5"] = "",
["ID6"] = "",
["ID7"] = "",
["ID8"] = "",
["ID9"] = "",
["LeftArm"] = "",
["LeftLeg"] = "",
["MageArmor"] = "",
["Magic"] = 0,
["MeleeArmor"] = "",
["PantSkirtDress"] = "",
["Priority"] = "",
["Range"] = 0,
["RangeArmor"] = "",
["RightArm"] = "",
["RightLeg"] = "",
["Shield"] = "OrangeShield",
["SkinColor"] = "0, 0, 0",
["Strength"] = 0,
["Sword"] = "",
["TopClothes"] = "",
["Torso"] = "",
["Wand"] = "LightningWand"
}
You canât have StringValues that have strings containing ;
in them, since it will cut part of the string.
You canât have strings that are numbers, since they will get converted to numbers and wonât stay as strings.
Again, you canât have nested tables unless you introduce more special characters that have to be excluded from all string values.
It might be fine for your use case, but you really shouldnât reinvent the wheel. JSON is a standard, it can convert all of the basic lua values, and you will have less chances of staying up at 3 am scratching your head trying to debug a string
when itâs actually a number
.
ooh I see well that is quite alright cause this data structure doesnât use any of those characters.
Iâll have to test one of those specifically. regarding not being able convert numbers along with strings
Iâm sure even if it were a number within a string it would still get converted since the sections are parsed by the key characters. if it were a number value you to write to a string that would be another issue entirely But yes you are correct about this not working with nested tables.