messages
listlengths
1
1
[ { "role": "assistant", "content": "-- ClientRemoteProperty\n-- Stephen Leitnick\n-- December 20, 2021\n\nlocal Promise = require(script.Parent.Parent.Parent.Promise)\nlocal Signal = require(script.Parent.Parent.Parent.Signal)\nlocal ClientRemoteSignal = require(script.Parent.ClientRemoteSignal)\nlocal Types...
[ { "role": "assistant", "content": "-- ClientRemoteSignal\n-- Stephen Leitnick\n-- December 20, 2021\n\nlocal Signal = require(script.Parent.Parent.Parent.Signal)\nlocal Types = require(script.Parent.Parent.Types)\n\n--[=[\n\t@class ClientRemoteSignal\n\t@client\n\tCreated via `ClientComm:GetSignal()`.\n]=]\...
[ { "role": "assistant", "content": "local Util = require(script.Parent.Util)\nlocal Types = require(script.Parent.Types)\nlocal Promise = require(script.Parent.Parent.Promise)\nlocal ClientRemoteSignal = require(script.ClientRemoteSignal)\nlocal ClientRemoteProperty = require(script.ClientRemoteProperty)\n\n...
[ { "role": "assistant", "content": "-- RemoteSignal\n-- Stephen Leitnick\n-- December 20, 2021\n\nlocal Players = game:GetService(\"Players\")\n\nlocal Signal = require(script.Parent.Parent.Parent.Signal)\nlocal Types = require(script.Parent.Parent.Types)\n\n--[=[\n\t@class RemoteSignal\n\t@server\n\tCreated...
[ { "role": "assistant", "content": "local RemoteProperty = require(script.RemoteProperty)\nlocal RemoteSignal = require(script.RemoteSignal)\nlocal Types = require(script.Parent.Types)\nlocal Util = require(script.Parent.Util)\n\nlocal Server = {}\n\n--[=[\n\t@within Comm\n\t@prop ServerComm ServerComm\n]=]\...
[ { "role": "assistant", "content": "-- Types\n-- Stephen Leitnick\n-- December 20, 2021\n\nexport type Args = {\n\tn: number,\n\t[any]: any,\n}\n\nexport type FnBind = (Instance, ...any) -> ...any\n\nexport type ServerMiddlewareFn = (Instance, Args) -> (boolean, ...any)\nexport type ServerMiddleware = { Serv...
[ { "role": "assistant", "content": "local RunService = game:GetService(\"RunService\")\n\nlocal Option = require(script.Parent.Parent.Option)\n\nlocal Util = {}\n\nUtil.IsServer = RunService:IsServer()\nUtil.WaitForChildTimeout = 60\nUtil.DefaultCommFolderName = \"__comm__\"\nUtil.None = newproxy()\n\nfuncti...
[ { "role": "assistant", "content": "-- Comm\n-- Stephen Leitnick\n-- August 05, 2021\n\n--[=[\n\t@class Comm\n\tRemote communication library.\n\n\tThis exposes the raw functions that are used by the `ServerComm` and `ClientComm` classes.\n\tThose two classes should be preferred over accessing the functions d...
[ { "role": "assistant", "content": "-- Component\n-- Stephen Leitnick\n-- November 26, 2021\n\ntype AncestorList = { Instance }\n\n--[=[\n\t@type ExtensionFn (component) -> ()\n\t@within Component\n]=]\ntype ExtensionFn = (any) -> ()\n\n--[=[\n\t@type ExtensionShouldFn (component) -> boolean\n\t@within Compo...
[ { "role": "assistant", "content": "local CollectionService = game:GetService(\"CollectionService\")\nlocal RunService = game:GetService(\"RunService\")\nlocal ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: T...
[ { "role": "assistant", "content": "--!strict\n\n-- Concur\n-- Stephen Leitnick\n-- May 01, 2022\n\ntype Error = any\ntype AnyFn = (...any) -> ...any\n\n--[=[\n\t@class Concur\n\n\tConcurrency class for helping run tasks concurrently. In other words, Concur allows\n\tdevelopers to watch coroutines/threads. C...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Concur = require(script.Parent)\n\n\tlocal function Awaiter(timeout: number)\n\t\tlocal awai...
[ { "role": "assistant", "content": "-- EnumList\n-- Stephen Leitnick\n-- January 08, 2021\n\ntype EnumNames = { string }\n\n--[=[\n\t@interface EnumItem\n\t.Name string\n\t.Value number\n\t.EnumType EnumList\n\t@within EnumList\n]=]\nexport type EnumItem = {\n\tName: string,\n\tValue: number,\n\tEnumType: an...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal EnumList = require(script.Parent)\n\n\tctx:Describe(\"Constructor\", function()\n\t\tctx:Tes...
[ { "role": "assistant", "content": "--!strict\n\n--[=[\n\t@class Find\n\n\tA utility function for finding objects in the data model hierarchy.\n\n\tSimilar to `FindFirstChild`, except it explicitly errors if any object\n\tis not found, as well as a more helpful message as to what wasn't found.\n\n\t```lua\n\...
[ { "role": "assistant", "content": "-- Gamepad\n-- Stephen Leitnick\n-- December 23, 2021\n\nlocal Signal = require(script.Parent.Parent.Signal)\nlocal Trove = require(script.Parent.Parent.Trove)\n\nlocal GuiService = game:GetService(\"GuiService\")\nlocal HapticService = game:GetService(\"HapticService\")\n...
[ { "role": "assistant", "content": "-- Keyboard\n-- Stephen Leitnick\n-- October 10, 2021\n\nlocal Signal = require(script.Parent.Parent.Signal)\nlocal Trove = require(script.Parent.Parent.Trove)\n\nlocal UserInputService = game:GetService(\"UserInputService\")\n\n--[=[\n\t@class Keyboard\n\t@client\n\n\tThe...
[ { "role": "assistant", "content": "-- Mouse\n-- Stephen Leitnick\n-- November 07, 2020\n\nlocal Signal = require(script.Parent.Parent.Signal)\nlocal Trove = require(script.Parent.Parent.Trove)\n\nlocal UserInputService = game:GetService(\"UserInputService\")\n\nlocal RAY_DISTANCE = 1000\n\n--[=[\n\t@class M...
[ { "role": "assistant", "content": "-- Touch\n-- Stephen Leitnick\n-- March 14, 2021\n\nlocal Trove = require(script.Parent.Parent.Trove)\nlocal Signal = require(script.Parent.Parent.Signal)\n\nlocal UserInputService = game:GetService(\"UserInputService\")\n\n--[=[\n\t@class Touch\n\t@client\n\n\tThe Touch c...
[ { "role": "assistant", "content": "-- Input\n-- Stephen Leitnick\n-- October 10, 2021\n\n--[=[\n\t@class Input\n\n\tThe Input package provides access to various user input classes.\n\n\t- [PreferredInput](/api/PreferredInput)\n\t- [Mouse](/api/Mouse)\n\t- [Keyboard](/api/Keyboard)\n\t- [Touch](/api/Touch)\n...
[ { "role": "assistant", "content": "--[=[\n\t@class Loader\n\n\tThe Loader module will require all children or descendant ModuleScripts. There are also\n\tsome utility functions included, which assist with loading and starting modules in\n\tsingle-script environments.\n\n\tFor example, here is a loader that ...
[ { "role": "assistant", "content": "local RunService = game:GetService(\"RunService\")\n\n--[=[\n\t@class Net\n\tBasic networking module for creating and handling static\n\tRemoteEvents and RemoteFunctions.\n]=]\nlocal Net = {}\n\n--[=[\n\tGets a RemoteEvent with the given name.\n\n\tOn the server, if the Re...
[ { "role": "assistant", "content": "-- Option\n-- Stephen Leitnick\n-- August 28, 2020\n\n--[[\n\n\tMatchTable {\n\t\tSome: (value: any) -> any\n\t\tNone: () -> any\n\t}\n\n\tCONSTRUCTORS:\n\n\t\tOption.Some(anyNonNilValue): Option<any>\n\t\tOption.Wrap(anyValue): Option<any>\n\n\n\tSTATIC FIELDS:\n\n\t\tOpt...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Option = require(script.Parent)\n\n\tctx:Describe(\"Some\", function()\n\t\tctx:Test(\"shoul...
[ { "role": "assistant", "content": "--!native\n\nexport type PID = {\n\tReset: (self: PID) -> (),\n\tCalculate: (self: PID, setpoint: number, input: number, deltaTime: number) -> number,\n\tDebug: (self: PID, name: string, parent: Instance?) -> (),\n\tDestroy: (self: PID) -> (),\n}\n\n--[=[\n\t@class PID\n\t...
[ { "role": "assistant", "content": "--!strict\n\n--[[\n\tAlgorithmic credit: https://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/index.htm\n]]\n\n--[=[\n\t@within Quaternion\n\t@interface Quaternion\n\t.X number\n\t.Y number\n\t.Z number\n\t.W number\n\n\tSimilar to Vector3s, Quaternio...
[ { "role": "assistant", "content": "--!strict\n\n--[=[\n\t@class Query\n\n\tAdds helpful functions that wrap\n\t[`Instance:QueryDescendants()`](https://create.roblox.com/docs/reference/engine/classes/Instance#QueryDescendants).\n]=]\n\nlocal Query = {}\n\n--[=[\n\t@within Query\n\n\tEquivalent to [`parent:Qu...
[ { "role": "assistant", "content": "export type Sequent<T> = {\n\tFire: (self: Sequent<T>, T) -> (),\n\tConnect: (self: Sequent<T>, callback: (SequentEvent<T>) -> ()) -> SequentConnection,\n\tOnce: (self: Sequent<T>, callback: (SequentEvent<T>) -> ()) -> SequentConnection,\n\tCancel: (self: Sequent<T>) -> ()...
[ { "role": "assistant", "content": "--!strict\n\n-- Ser\n-- Stephen Leitnick\n-- August 28, 2020\n\n--[[\n\n\tSer is a serialization/deserialization utility module that is used\n\tby Knit to automatically serialize/deserialize values passing\n\tthrough remote functions and remote events.\n\n\n\tSer.Classes =...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Option = require(script.Parent.Parent.Option)\n\tlocal Ser = require(script.Parent)\n\n\tctx...
[ { "role": "assistant", "content": "local RunService = game:GetService(\"RunService\")\nlocal ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nlocal function AwaitStop(shake): number\n\tlocal start = os.clock()\n\tshake:Update()\n\...
[ { "role": "assistant", "content": "-- -----------------------------------------------------------------------------\n-- Batched Yield-Safe Signal Implementation --\n-- This is a Signal class which has effectively identical behavior to a --\n-- normal RBXScriptSignal, ...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nlocal function AwaitCondition(predicate: () -> boolean, timeout: number?)\n\tlocal start = os.clock()\n\ttimeout = (timeout or 10)\n\twhile ...
[ { "role": "assistant", "content": "--!strict\n\n-- TableWatcher\n-- Stephen Leitnick\n-- April 29, 2022\n\ntype AnyTable = { [any]: any }\n\ntype Watcher = {\n\tChanges: AnyTable,\n\tTbl: AnyTable,\n}\n\nlocal Util = require(script.Parent.Util)\n\nlocal watchers: { [TableWatcher]: Watcher } = {}\nsetmetatab...
[ { "role": "assistant", "content": "--!strict\n\n-- Util\n-- Stephen Leitnick\n-- April 29, 2022\n\ntype AnyTable = { [any]: any }\n\nlocal Util = {}\n\nUtil.None = newproxy()\n\n-- Recursive table freeze.\nfunction Util.DeepFreeze<T>(tbl: AnyTable): AnyTable\n\ttable.freeze(tbl)\n\tfor _, v in tbl do\n\t\ti...
[ { "role": "assistant", "content": "-- Silo\n-- Stephen Leitnick\n-- April 29, 2022\n\n--[=[\n\t@within Silo\n\t@type State<S> {[string]: any}\n\tRepresents state.\n]=]\nexport type State<S> = S & { [string]: any }\n\n--[=[\n\t@within Silo\n\t@type Modifier<S> (State<S>, any) -> ()\n\tA function that modifie...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Silo = require(script.Parent)\n\n\tlocal silo1, silo2, rootSilo\n\n\tctx:BeforeEach(function...
[ { "role": "assistant", "content": "--!strict\n\n--[=[\n\t@class Spring\n\n\tSimulates a critically damped spring. This is mostly just a wrapper around\n\t[`TweenService:SmoothDamp()`](https://create.roblox.com/docs/reference/engine/classes/TweenService#SmoothDamp).\n]=]\n\nlocal TweenService = game:GetServi...
[ { "role": "assistant", "content": "--!native\n--!strict\n\n--[=[\n\t@class stream\n\n\tThe `stream` library allows a stream-like interface abstraction on top of buffers. This is useful\n\tfor reading or writing buffers without having to keep track of the current offset position.\n\n\tThis library is specifi...
[ { "role": "assistant", "content": "--!strict\n\n-- Streamable\n-- Stephen Leitnick\n-- March 03, 2021\n\ntype StreamableWithInstance = {\n\tInstance: Instance?,\n\t[any]: any,\n}\n\nlocal Trove = require(script.Parent.Parent.Trove)\nlocal Signal = require(script.Parent.Parent.Signal)\n\n--[=[\n\t@within Str...
[ { "role": "assistant", "content": "--!strict\n\n-- StreamableUtil\n-- Stephen Leitnick\n-- March 03, 2021\n\nlocal Trove = require(script.Parent.Parent.Trove)\nlocal _Streamable = require(script.Parent.Streamable)\n\ntype Streamables = { _Streamable.Streamable }\ntype CompoundHandler = (Streamables, any) ->...
[ { "role": "assistant", "content": "-- Streamable\n-- Stephen Leitnick\n-- November 08, 2021\n\nreturn {\n\tStreamable = require(script.Streamable),\n\tStreamableUtil = require(script.StreamableUtil),\n}\n" } ]
[ { "role": "assistant", "content": "-- Symbol\n-- Stephen Leitnick\n-- January 04, 2022\n\n--[=[\n\t@class Symbol\n\n\tRepresents a unique object.\n\n\tSymbols are often used as unique keys in tables. This is useful to avoid possible collisions\n\twith a key in a table, since the symbol will always be unique...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Symbol = require(script.Parent)\n\n\tctx:Describe(\"Constructor\", function()\n\t\tctx:Test(...
[ { "role": "assistant", "content": "--!strict\n\n-- TableUtil\n-- Stephen Leitnick\n-- September 13, 2017\n\n--[=[\n\t@class TableUtil\n\n\tA collection of helpful table utility functions. Many of these functions are carried over from JavaScript or\n\tPython that are not present in Lua.\n\n\tTables that only...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal TableUtil = require(script.Parent)\n\n\tctx:Describe(\"Copy (Deep)\", function()\n\t\tctx:Te...
[ { "role": "assistant", "content": "-- TaskQueue\n-- Stephen Leitnick\n-- November 20, 2021\n\n--[=[\n\t@class TaskQueue\n\tA queue that flushes all objects at the end of the current\n\texecution step. This works by scheduling all tasks with\n\t`task.defer`.\n\n\tA possible use-case is to batch all requests ...
[ { "role": "assistant", "content": "--!strict\n\nlocal RunService = game:GetService(\"RunService\")\n\nlocal Signal = require(script.Parent.Signal)\n\n--[=[\n\t@within Timer\n\t@type CallbackFn () -> ()\n\tCallback function.\n]=]\ntype CallbackFn = () -> nil\n\n--[=[\n\t@within Timer\n\t@type TimeFn () -> nu...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Timer = require(script.Parent)\n\n\tctx:Describe(\"Timer\", function()\n\t\tlocal timer\n\n\...
[ { "role": "assistant", "content": "local DELIM = \"/\"\n\nlocal function FullNameToPath(instance: Instance): string\n\treturn instance:GetFullName():gsub(\"%.\", DELIM)\nend\n\n--[=[\n\t@class Tree\n]=]\nlocal Tree = {}\n\n--[=[\n\tSimilar to FindFirstChild, with a few key differences:\n\t- An error is thro...
[ { "role": "assistant", "content": "--!strict\n\nlocal RunService = game:GetService(\"RunService\")\n\nexport type Trove = {\n\tExtend: (self: Trove) -> Trove,\n\tClone: <T>(self: Trove, instance: T & Instance) -> T,\n\tConstruct: <T, A...>(self: Trove, class: Constructable<T, A...>, A...) -> T,\n\tConnect: ...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Trove = require(script.Parent)\n\n\tctx:Describe(\"Trove\", function()\n\t\tlocal trove\n\n\...
[ { "role": "assistant", "content": "--!strict\n\ntype Signal<T...> = {\n\tConnect: (self: Signal<T...>, fn: (T...) -> ()) -> RBXScriptConnection,\n\tConnectParallel: (self: Signal<T...>, fn: (T...) -> ()) -> RBXScriptConnection,\n\tOnce: (self: Signal<T...>, fn: (T...) -> ()) -> RBXScriptConnection,\n\tWait:...
[ { "role": "assistant", "content": "-- WaitFor\n-- Stephen Leitnick\n-- January 17, 2022\n\nlocal RunService = game:GetService(\"RunService\")\n\nlocal Promise = require(script.Parent.Promise)\n\nlocal DEFAULT_TIMEOUT = 60\n\n--[=[\n\t@class WaitFor\n\tUtility class for awaiting the existence of instances.\n...
[ { "role": "assistant", "content": "local ServerScriptService = game:GetService(\"ServerScriptService\")\n\nlocal Test = require(ServerScriptService.TestRunner.Test)\n\nreturn function(ctx: Test.TestContext)\n\tlocal Promise = require(script.Parent.Parent.Promise)\n\tlocal WaitFor = require(script.Parent)\n\...
[ { "role": "assistant", "content": "--[[\nCryptography library: Advanced Encryption Standard (Galois/Counter Mode)\n\t\n\tSecurity Limitations:\n\t\tPersonally don't really like AES-GCM as it has a 96-bit nonce \n\t\twhich creates birthday bound issues after 2^32 encryptions with the same key, \n\t\tcollisio...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: EdDSA Batch Verification\n\tEfficient Verification of Multiple Signatures\n\n\tThis example shows how u can batch verification of multiple Ed25519 signatures.\n\tBatch verification is more efficient than verifying signatures individually\n\tw...
[ { "role": "assistant", "content": "--[[ Cryptography library: CSPRNG Example ]]--\n--!strict\n\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\n\n-- Get the library\nlocal Cryptography = require(ReplicatedStorage:WaitForChild(\"Cryptography\"))\nlocal CSPRNG = Cryptography.Utilities.CSPRNG...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Ephemeral X25519 Key Exchange\n\tForward Secrecy - Client to Server Key Exchange with Ephemeral Keys\n\n\tThis example shows how to do proper ephemeral key exchange that provides forward secrecy.\n\tFresh private keys are generated each sessi...
[ { "role": "assistant", "content": "--!strict\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\n\n-- Get the library\nlocal Cryptography = require(ReplicatedStorage:WaitForChild(\"Cryptography\"))\nlocal MLDSA = Cryptography.Verification.MlDSA\nlocal CSPRNG = Cryptography.Utilities.CSPRNG\n\...
[ { "role": "assistant", "content": "--!strict\nlocal ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\n-- Get the library\nlocal Cryptography = require(ReplicatedStorage:WaitForChild(\"Cryptography\"))\nlocal MlKem = Cryptography.Verification.MlKEM\nlocal CSPRNG = Cryptography.Utilities.CSPRNG\n\n-...
[ { "role": "assistant", "content": "--[=[\n\tPassword Storage System using BLAKE3\n\t\n\tThis system uses BLAKE3 for password hashing instead of Argon2id.\n\t\n\tIdea:\n\t\tArgon2id intentionally slows down each hash to make brute force attacks expensive.\n\t\tThis is needed when users choose their own passw...
[ { "role": "assistant", "content": "local ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal Cryptography = ReplicatedStorage:WaitForChild(\"Cryptography\")\nlocal Tests = Cryptography.Testing\n\nfor _, Test: ModuleScript in Tests:GetChildren() do\n\trequire(Test)\nend\n\nreturn nil\n" } ]
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Adler\n\n\tReturn type: number\n\tExample Usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Hash = Adler(Message)\n--]=]\n\n--!strict\n--!optimize 2\n--!native\n\nlocal function Adler(Message: buffer): number\n\tlocal ...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: CRC32\n\tFunction can return JAM or ISO-HDLC CRC32 checksums.\n\t\n\tReturn type: number in regular mode, string in hex mode\n\tExample Usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\t\n\t\t--------Usage Case 1--------\n\t...
[ { "role": "assistant", "content": "--!strict\n\nlocal Algorithms = table.freeze({\n\tCRC32 = require(\"@self/CRC32\"),\n\tAdler = require(\"@self/Adler\")\n})\n\nreturn Algorithms" } ]
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: ChaCha20\n\t\n\tSizes:\n\t\tNonce: 12/24 bytes\n\t\tKey: 16/32 bytes\n\t\n\tReturn type: buffer\n\tExample usage:\n\t\tlocal Data = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(string.rep(\"k\", 32))\n\t\tlocal Nonce ...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Poly1305\n\t\n\tSizes:\n\t\tKey: 32 bytes\n\t\tTag: 16 bytes\n\t\n\tReturn type: buffer\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(string.rep(\"k\", 32))\n\t\t\n\t\tlocal Tag =...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: ChaCha20-Poly1305 AEAD\n\t\n\tSizes:\n\t\tKey: 16/32 bytes\n\t\tNonce: 12/24 bytes\n\t\tTag: 16 bytes\n\t\tRounds: even positive integer (default: 20)\n\t\n\tReturn type: buffer, buffer (ciphertext, tag)\n\tExample usage:\n\t\tlocal Plaintext...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: AES\n\t\n\tSizes:\n\t\tInit Vector: 16 bytes\n\t\tKey Size: 16 / 24 / 32 bytes\n\t\n\tExample usage:\n\tlocal Key = CSPRNG.RandomBytes(32)\n\tlocal IV = CSPRNG.RandomBytes(12)\n\n\tlocal Message = \"This is a secret message\"\n\tlocal Plainte...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Simon Cipher 64-bit\n\n\t⚠️ WARNING: Simon is not very secure!\n\tFor security, use AES or CHACHA20. ⚠️\n\n\tSizes:\n\t\tKey: 16 bytes\n\n\tReturn type: buffer\n\tExample Usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tloc...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Speck\n\n\t⚠️ WARNING: Speck is not very secure!\n\tFor security, use AES or CHACHA20. ⚠️\n\n\tSizes:\n\t\tKey: 8 bytes\n\n\tReturn type: buffer\n\tExample Usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: XOR Symmetric Cipher\n\n\t⚠️ WARNING: XOR is not cryptographically secure!\n\tDo not use the same key twice!\n\tFor security, use AES or CHACHA20. ⚠️\n\n\tReturn type: buffer \n\tExample Usage:\n\t\tlocal Message = buffer.fromstring(\"Hello W...
[ { "role": "assistant", "content": "--!strict\n\nlocal Algorithms = table.freeze({\n\tAEAD = require(\"@self/AEAD\"),\n\tAES = require(\"@self/AES\"),\n\tXOR = require(\"@self/XOR\"),\n\tSimon = require(\"@self/Simon\"),\n\tSpeck = require(\"@self/Speck\")\n})\n\nreturn Algorithms" } ]
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: BLAKE2b\n\t\n\tReturn type: string\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\t\n\t\t-- BLAKE2b-128 (128-bit output)\n\t\tlocal Result128 = BLAKE2b(Message, 16)\n\t\t\n\t\t-- BLAKE2b-256 (256-bit output)\n\t...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Blake3\n\t\n\tSizes:\n\t\tKey: 32 bytes\n\t\tOutput: variable\n\t\n\tReturn type: string (hex)\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(string.rep(\"k\", 32))\n\t\t\n\t\t----...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: HMAC\n\t\n\tReturn type: string or function\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(\"Key\")\n\t\tlocal BlockSize = 64 -- SHA256 block length (= string.len(SHA256(...)))\n\t...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: HKDF (HMAC-based Key Derivation Function)\n\n\tRFC 5869 extract-then-expand key derivation built on HMAC.\n\n\tReturn type: buffer\n\tExample usage:\n\t\tlocal IKM = buffer.fromstring(\"input key material\")\n\t\tlocal OKM = HKDF(IKM, Salt, I...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: KMAC (Keccak Message Authentication Code)\n\t\n\tKMAC128 and KMAC256 are keyed hash functions based on cSHAKE128 and cSHAKE256.\n\tThey give variable length output and strong authentication.\n\t\n\tUnlike SHAKE and cSHAKE, changing the output...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: MD5\n\t\n\t⚠️ WARNING: MD5 is cryptographically broken!\n\tOnly use for legacy compatibility, checksums, or non-security purposes.\n\tFor security, use SHA256 or higher. ⚠️\n\t\n\tReturn type: string\n\tUsage:\n\t\tlocal Message = buffer.from...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: MurmurHash3-32\n\t\n\t⚠️ WARNING: MurmurHash3 wasn't designed with cryptographic security in mind!\n\tOnly use for non-security purposes like hash tables or hyperloglog. For security, use SHA256 or higher. ⚠️\n\t\n\tMurmurHash3 is a fast non-...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: SHA1\n\t\n\t⚠️ WARNING: SHA1 is cryptographically broken!\n\tOnly use for legacy compatibility, checksums, or non-security purposes.\n\tFor security, use SHA256 or higher. ⚠️\n\n\tSizes:\n\t\tDigest: 20 bytes\n\t\n\tReturn type: string\n\tExa...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: SHA224\n\t\n\tSizes:\n\t\tDigest: 28 bytes\n\n\tReturn type: string\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Result = SHA224(Message)\n--]=]\n\n--!strict\n--!optimize 2\n--!native\n\nlocal CONSTANTS...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: SHA256\n\n\tSizes:\n\t\tDigest: 32 bytes\n\t\n\tReturn type: string\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Result = SHA256(Message)\n--]=]\n\n--!strict\n--!optimize 2\n--!native\nlocal CONSTANTS =...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: SHA384\n\n\tSizes:\n\t\tDigest: 48 bytes\n\n\tReturn type: (string, buffer)\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Hash, HashBuffer = SHA384(Message)\n--]=]\n\n--!strict\n--!optimize 2\n--!native\...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: SHA512\n\n\tSizes:\n\t\tDigest: 64 bytes\n\n\tReturn type: (string, buffer)\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Hash, HashBuffer = SHA512(Message)\n--]=]\n\n--!strict\n--!optimize 2\n--!native\...
[ { "role": "assistant", "content": "--[[\n\tCryptography library: SHA2 Family\n--]]\n\nreturn {\n\tSHA224 = require(\"@self/SHA224\"),\n\tSHA256 = require(\"@self/SHA256\"),\n\tSHA384 = require(\"@self/SHA384\"),\n\tSHA512 = require(\"@self/SHA512\"),\n}" } ]
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Keccak/SHA-3\n\t\n\tSizes:\n\t\tSHA3-224 Digest: 28 bytes\n\t\tSHA3-256 Digest: 32 bytes\n\t\tSHA3-384 Digest: 48 bytes\n\t\tSHA3-512 Digest: 64 bytes\n\t\tSHAKE128 Digest: variable\n\t\tSHAKE256 Digest: variable\n\n\tReturn type: string\n\tE...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: XXHash32\n\t\n\t⚠️ WARNING: XXHash32 wasn't designed with cryptographic security in mind!\n\tOnly use for non-security purposes. For security, use SHA256 or higher. ⚠️\n\t\n\tReturn type: number\n\tExample usage:\n\t\tlocal Message = buffer.f...
[ { "role": "assistant", "content": "--!strict\n\nlocal Algorithms = table.freeze({\n\tHMAC = require(\"@self/HMAC\"),\n\tHKDF = require(\"@self/HKDF\"),\n\tKMAC = require(\"@self/KMAC\"),\n\tMD5 = require(\"@self/MD5\"),\n\tSHA1 = require(\"@self/SHA1\"),\n\tSHA2 = require(\"@self/SHA2\"),\n\tSHA3 = require(...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Base64\n\t\n\tReturn type: buffer\n\tExample usage:\n\t\tlocal Input = buffer.fromstring(\"Hello World\")\n\t\tlocal Encoded = Base64.Encode(Input)\n\t\tlocal Decoded = Base64.Decode(Encoded)\n--]=]\n\n--!strict\n--!optimize 2\n--!native\n\nl...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Blake3\n\t\n\tSizes:\n\t\tKey: 32 bytes\n\t\tOutput: variable\n\t\n\tReturn type: string (hex)\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(string.rep(\"k\", 32))\n\t\t\n\t\t----...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: ChaCha20\n\t\n\tSizes:\n\t\tNonce: 12 bytes\n\t\tKey: 16/32 bytes\n\t\n\tReturn type: buffer\n\tExample usage:\n\t\tlocal Data = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(string.rep(\"k\", 32))\n\t\tlocal Nonce = b...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Conversions\n\t\n\tReturn type: string / buffer\n\tExample Usage:\n\t\tlocal HexString = Conversions.ToHex(buffer.fromstring(\"Hello World\"))\n\t\tlocal OriginalBuffer = Conversions.FromHex(\"48656c6c6f20576f726c64\")\n--]=]\n\n--!strict\n--...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Cryptographically Secure RNG\n\t\n\tUsage:\n\t\tlocal RandomFloat = CSPRNG.Random()\n\t\tlocal RandomInt = CSPRNG.RandomInt(1, 100)\n\t\tlocal RandomNumber = CSPRNG.RandomNumber(0.5, 10.5)\n\t\tlocal RandomBytes = CSPRNG.RandomBytes(32)\n\t\t...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Random String Generator\n\t\n\t⚠️WARNING: This is not using cryptographically secure random numbers. \n\tFor Security use CSPRNG.⚠️\n\t\n\tReturn type: string | buffer\n\tExample Usage:\n\t\tlocal String = RandomString(500)\n--]=]\n\n--!stric...
[ { "role": "assistant", "content": "--!strict\n\nlocal Algorithms = table.freeze({\n\tRandomString = require(\"@self/RandomString\"),\n\tConversions = require(\"@self/Conversions\"),\n\tBase64 = require(\"@self/Base64\"),\n\tCSPRNG = require(\"@self/CSPRNG\")\n})\n\nreturn Algorithms" } ]
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Blake3\n\t\n\tSizes:\n\t\tKey: 32 bytes\n\t\tOutput: variable\n\t\n\tReturn type: string (hex)\n\tExample usage:\n\t\tlocal Message = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(string.rep(\"k\", 32))\n\t\t\n\t\t----...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: ChaCha20\n\t\n\tSizes:\n\t\tNonce: 12 bytes\n\t\tKey: 16/32 bytes\n\t\n\tReturn type: buffer\n\tExample usage:\n\t\tlocal Data = buffer.fromstring(\"Hello World\")\n\t\tlocal Key = buffer.fromstring(string.rep(\"k\", 32))\n\t\tlocal Nonce = b...
[ { "role": "assistant", "content": "--[=[\n\tCryptography library: Cryptographically Secure RNG\n\t\n\tUsage:\n\t\tlocal RandomFloat = CSPRNG.Random()\n\t\tlocal RandomInt = CSPRNG.RandomInt(1, 100)\n\t\tlocal RandomNumber = CSPRNG.RandomNumber(0.5, 10.5)\n\t\tlocal RandomBytes = CSPRNG.RandomBytes(32)\n\t\t...