repo
stringclasses
350 values
file_path
stringlengths
29
200
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.01M
tokens
int64
2
598k
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Utilities/CSPRNG/ChaCha20.luau
luau
.luau
--[=[ Cryptography library: ChaCha20 Sizes: Nonce: 12 bytes Key: 16/32 bytes Return type: buffer Example usage: local Data = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) local Nonce = buffer.fromstring(string.rep("n", 12)) --------Usage Case 1-------- loca...
3,274
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Utilities/CSPRNG/Conversions.luau
luau
.luau
--[=[ Cryptography library: Conversions Return type: string / buffer Example Usage: local HexString = Conversions.ToHex(buffer.fromstring("Hello World")) local OriginalBuffer = Conversions.FromHex("48656c6c6f20576f726c64") --]=] --!strict --!optimize 2 --!native local ENCODE_LOOKUP = buffer.create(256 * 2) d...
1,625
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Utilities/CSPRNG/init.luau
luau
.luau
--[=[ Cryptography library: Cryptographically Secure RNG Usage: local RandomFloat = CSPRNG.Random() local RandomInt = CSPRNG.RandomInt(1, 100) local RandomNumber = CSPRNG.RandomNumber(0.5, 10.5) local RandomBytes = CSPRNG.RandomBytes(32) local RandomHex = CSPRNG.RandomHex(16) local FastString = CSPRNG.R...
5,210
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Utilities/RandomString.luau
luau
.luau
--[=[ Cryptography library: Random String Generator ⚠️WARNING: This is not using cryptographically secure random numbers. For Security use CSPRNG.⚠️ Return type: string | buffer Example Usage: local String = RandomString(500) --]=] --!strict --!optimize 2 --!native local function RandomString(Length: numb...
159
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Utilities/init.luau
luau
.luau
--!strict local Algorithms = table.freeze({ RandomString = require("@self/RandomString"), Conversions = require("@self/Conversions"), Base64 = require("@self/Base64"), CSPRNG = require("@self/CSPRNG") }) return Algorithms
55
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/CSPRNG/Blake3.luau
luau
.luau
--[=[ Cryptography library: Blake3 Sizes: Key: 32 bytes Output: variable Return type: string (hex) Example usage: local Message = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) --------Standard Hash-------- local Hash = Blake3.Digest(Message, 32) --------...
3,543
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/CSPRNG/ChaCha20.luau
luau
.luau
--[=[ Cryptography library: ChaCha20 Sizes: Nonce: 12 bytes Key: 16/32 bytes Return type: buffer Example usage: local Data = buffer.fromstring("Hello World") local Key = buffer.fromstring(string.rep("k", 32)) local Nonce = buffer.fromstring(string.rep("n", 12)) --------Usage Case 1-------- loca...
3,202
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/Curve25519.luau
luau
.luau
--[=[ Cryptography library: Curve25519 Montgomery Return type: varies by function Example usage: local Curve25519 = require("Curve25519") local FieldQuadratic = require("FieldQuadratic") --------Usage Case 1: Point multiplication-------- local BasePoint = Curve25519.G local SomeScalar = FieldQuadratic.De...
2,818
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/Edwards25519.luau
luau
.luau
--[=[ Cryptography library: Edwards25519 Return type: varies by function Example usage: local Edwards = require("Edwards25519") local FieldQuadratic = require("FieldQuadratic") --------Usage Case 1: Point addition-------- local Point1 = Edwards.Decode(SomeEncodedBuffer) local Point2 = Edwards.Decode(Anot...
11,461
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/FieldPrime.luau
luau
.luau
--[=[ Cryptography library: Field Prime (Curve25519 Base Field) Return type: varies by function Example usage: local FieldPrime = require("FieldPrime") --------Usage Case 1: Basic arithmetic-------- local ElementA = FieldPrime.Num(42) local ElementB = FieldPrime.Num(17) local Sum = FieldPrime.Add(Element...
12,113
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/FieldQuadratic.luau
luau
.luau
--[=[ Cryptography library: Field Quadratic (Curve25519 Scalar Field) Return type: varies by function Example usage: local FieldQuadratic = require("FieldQuadratic") --------Usage Case 1: Basic scalar arithmetic-------- local ScalarA = FieldQuadratic.Decode(SomeBytes) local ScalarB = FieldQuadratic.Decode(...
3,927
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/MultiPrecision.luau
luau
.luau
--[=[ Cryptography library: Multi-Precision Arithmetic (264-bit integers) Return type: varies by function Example usage: local MultiPrecision = require("MultiPrecision") --------Usage Case 1: Basic arithmetic-------- local NumberA = MultiPrecision.Num(42) local NumberB = MultiPrecision.Num(17) local Sum ...
5,898
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/SHA512.luau
luau
.luau
--!strict --!optimize 2 --!native local K_HI = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5...
4,655
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/EdDSA/X25519.luau
luau
.luau
--[=[ Cryptography library: X25519 with cofactor clearing Return type: varies by function Example usage: local AlicePrivate = CSPRNG.Ed25519Random() local BobPrivate = CSPRNG.Ed25519Random() local AliceMasked = X25519.Mask(AlicePrivate) local BobMasked = X25519.Mask(BobPrivate) local AlicePublic = X2551...
2,513
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/Field.luau
luau
.luau
--[=[ Finite field arithmetic modulo Q = 8380417 Arithmetic operations over the prime field Z_q where q = 2^23 - 2^13 + 1. All operations maintain elements in canonical form [0, Q). Example usage: local Field = require(script) local A = 12345 local B = 67890 local Sum = Field.Add(A, B) local Product...
451
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/NTT.luau
luau
.luau
--[=[ Number Theoretic Transform for degree-255 polynomials Forward and inverse NTT over Z_q for polynomial multiplication. Uses Cooley-Tukey and Gentleman-Sande algorithms with precomputed roots. Example usage: local NTT = require(script) local Poly = buffer.create(256 * 4) -- 256 coefficients, 4 bytes ...
1,459
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/Pack.luau
luau
.luau
--[=[ Bit packing and unpacking utilities Serializes polynomials to byte arrays with various bit widths. Supports encoding/decoding of polynomial coefficients and hint bits. Example usage: local BitPacking = require(script) local Poly = buffer.create(256 * 4) local Encoded = buffer.create(96) -- For 3-b...
5,403
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/Params.luau
luau
.luau
--[=[ Parameter validation for ML-DSA algorithms FIPS 204 specification. Example usage: local Params = require(script) local IsValid = Params.CheckKeygenParams(4, 4, 13, 2) -- ML-DSA-44 local ValidEta = Params.CheckEta(2) --]=] --!strict --!optimize 2 --!native local Q = 8380417 local Params = {} fun...
993
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/PolyVec.luau
luau
.luau
--[=[ Vector operations on degree-255 polynomials Works on vectors of polynomials including matrix multiplication, NTT transforms, and encoding/decoding for ML-DSA. Example usage: local PolyVec = require(script) local Vec = buffer.create(4 * 256 * 4) -- 4 polynomials PolyVec.ForwardNTT(Vec, 4) local N...
9,419
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/SHA3.luau
luau
.luau
--!strict --!optimize 2 --!native local SHA3 = {} local LOW_ROUND, HIGH_ROUND = buffer.create(96), buffer.create(96) do local HighFactorKeccak = 0 local ShiftRegister = 29 local function GetNextBit(): number local Result = ShiftRegister % 2 ShiftRegister = bit32.bxor((ShiftRegister - Result) // 2, 142 * Result...
6,803
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/Sampling.luau
luau
.luau
--[=[ ML-DSA Sampling Example usage: local Sampling = require(script) local Rho = buffer.create(32) local Matrix = buffer.create(4 * 4 * 256 * 4) Sampling.ExpandA(Rho, Matrix, 4, 4) --]=] --!strict --!optimize 2 --!native local XOF = require("./XOF") local Params = require("./Params") local N = 256 lo...
4,853
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/Utils.luau
luau
.luau
--[=[ Utility functions for ML-DSA key and signature sizes ML-DSA parameters. Example usage: local Utils = require(script) local PubKeySize = Utils.PubKeyLen(4, 13) -- 1312 bytes for ML-DSA-44 local SecKeySize = Utils.SecKeyLen(4, 4, 2, 13) -- 2560 bytes local SigSize = Utils.SigLen(4, 4, 131072, 80, ...
448
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/XOF.luau
luau
.luau
--[=[ Stateful SHAKE XOF (Extensible Output Function) Non-OOP implementation with reusable state buffers. For ML-DSA sampling functions that use rejection sampling. Example usage: local XOF = require(script) XOF.Reset128() XOF.Absorb128(message) local Chunk1 = XOF.Squeeze128(168) local Chunk2 = XOF...
8,128
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlDSA/init.luau
luau
.luau
--[=[ ML-DSA (FIPS 204) Digital Signature Algorithm Post quantum digital signature scheme based on lattice cryptography. Has three security levels: ML-DSA-44, ML-DSA-65, ML-DSA-87. Example usage: local MLDSA = require("@self/MlDSA") local PubKey, SecKey = MLDSA.ML_DSA_44.GenerateKeys() local Message = b...
7,249
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/Compression.luau
luau
.luau
--[=[ ML-KEM Compression Module Polynomial coefficient compression and decompression operations for ML-KEM. Maps field elements to and from reduced bit representations. --]=] --!strict --!optimize 2 --!native local Params = require("./Params") local N = 256 local Q = 3329 local Compression = {} function Compr...
1,449
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/Field.luau
luau
.luau
--[=[ ML-KEM Field Arithmetic Module Prime field Zq arithmetic operations for ML-KEM. Modular arithmetic over the field Z_q where q = 3329. Example usage: local Field = require(script.Field) local Sum = Field.Add(1234, 567) local Product = Field.Multiply(1234, 567) local Inverse = Field.Invert(1234) ...
511
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/NTT.luau
luau
.luau
--[=[ ML-KEM Number Theoretic Transform Module Number Theoretic Transform (NTT) operations for polynomial multiplication. Cooley-Tukey NTT and Gentleman-Sande inverse NTT algorithms Example usage: local NTT = require(script.NTT) local Poly = buffer.create(512) -- 256 coefficients * 2 bytes NTT.Ntt(Pol...
3,057
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/PKE.luau
luau
.luau
--[=[ ML-KEM Public Key Encryption Module K-PKE (CPA-secure public key encryption) implementation for ML-KEM. Provides key generation, encryption, and decryption operations as specified in NIST FIPS 203. Example usage: local PKE = require(script.PKE) local Seed = buffer.fromstring("32_byte_seed_here..."...
2,481
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/Params.luau
luau
.luau
--[=[ ML-KEM Parameters Module Parameter validation functions for ML-KEM. NIST FIPS 203 specification. Example usage: local Params = require(script.Params) local IsValid = Params.CheckKeygenParams(4, 2) -- true local ValidD = Params.CheckD(11) -- true local ValidEncrypt = Params.CheckEncryptParams(4,...
722
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/PolyVec.luau
luau
.luau
--[=[ ML-KEM Polynomial Vector Module Polynomial vector and matrix operations for ML-KEM. Vector arithmetic, matrix multiplication, and encoding/decoding operations on vectors of degree-255 polynomials. --]=] --!strict --!optimize 2 --!native local Ntt = require("./NTT") local MlKemParams = require("./Params") ...
1,569
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/SHA3.luau
luau
.luau
--!strict --!optimize 2 --!native local SHA3 = {} local LOW_ROUND, HIGH_ROUND = buffer.create(96), buffer.create(96) do local HighFactorKeccak = 0 local ShiftRegister = 29 local function GetNextBit(): number local Result = ShiftRegister % 2 ShiftRegister = bit32.bxor((ShiftRegister - Result) // 2, 142 * Result...
6,832
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/Sampling.luau
luau
.luau
--[=[ ML-KEM Sampling Module Polynomial sampling operations for ML-KEM. Uniform sampling from Rq and centered binomial distribution sampling. Example usage: local Sampling = require(script.Sampling) local Rho = buffer.create(32) local Matrix = Sampling.GenerateMatrix(3, Rho, false) local Sigma = ...
1,932
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/Serialize.luau
luau
.luau
--[=[ ML-KEM Serialization Module Polynomial encoding and decoding operations for ML-KEM. Converts polynomials to/from byte arrays with different bit lengths. Example usage: local Serialize = require(script.Serialize) local Poly = buffer.create(512) -- 256 coefficients local Encoded = Serialize.Encode...
4,688
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/Utils.luau
luau
.luau
--[=[ ML-KEM Utilities Module Utility functions for ML-KEM implementation Example usage: local Utils = require(script.Utils) local IsEqual = Utils.CtMemcmp(Buffer1, Buffer2) Utils.CtCondMemcpy(Condition, Dest, Src1, Src2) local PubKeySize = Utils.GetKemPublicKeyLen(4) -- 1568 bytes local SecKeySi...
1,023
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/MlKEM/init.luau
luau
.luau
--[=[ ML-KEM Main Module (Key Encapsulation Mechanism) The complete ML-KEM post quantum key encapsulation. Key generation, encapsulation, and decapsulation operations with CCA security using the Fujisaki Okamoto transform. Example usage: local MlKem = require(script.MlKem) local CSPRNG = require(script.CSP...
2,691
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/Verification/init.luau
luau
.luau
--!strict local Algorithms = table.freeze({ EdDSA = require("@self/EdDSA"), MlDSA = require("@self/MlDSA"), MlKEM = require("@self/MlKEM"), }) return Algorithms
48
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/src/init.luau
luau
.luau
--!strict local Cryptography = table.freeze({ Hashing = require("@self/Hashing"), Checksums = require("@self/Checksums"), Utilities = require("@self/Utilities"), Encryption = require("@self/Encryption"), Verification = require("@self/Verification") }) return Cryptography
64
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/Adler.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number } type TestVectors = {[string]: TestVector} local Algorithm = require("../Checksums/Adler") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = 0x1 }, ["a"] = { Description = "Single...
454
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/Base64.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string, Algorithm: "Encode" | "Decode" } type TestVectors = {[string]: TestVector} local Algorithm = require("../Utilities/Base64") local TestVectors: TestVectors = { ["VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IG...
680
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/Blake2b.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string, OutLen: number?, Key: string? } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/Blake2b") local TestVectors: TestVectors = { ["abc"] = { Description = "Basic ABC Test", Expecte...
6,247
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/Blake3.luau
luau
.luau
--!strict local Testing = require("./") local Algorithm = require("../Hashing/Blake3") local New = { Key = "whats the Elvish word for friend", ContextString = "BLAKE3 2019-12-27 16:29:52 test vectors context", Cases = { { InputLen = 0, Hash = "af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262...
17,231
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/CRC32.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number } type TestVectors = {[string]: TestVector} local Algorithm = require("../Checksums/CRC32") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = 0x00000000 }, ["The quick brown fox jum...
553
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/CSPRNG.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Utilities/CSPRNG") Testing.Describe("CSPRNG Algorithm Tests", function() Testing.Test("Ed25519 Functions", function() local Ed25519Bytes = ...
3,006
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/MD5.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/MD5") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "d41d8cd98f00b204e9800998ecf8427e" }, ["The...
705
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/Murmur.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number, Seed: number } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/Murmur") local TestVectors: TestVectors = { [""] = { Description = "Empty String (Seed 0x00)", Expected = 0x000...
1,095
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/SHA1.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA1") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "da39a3ee5e6b4b0d3255bfef95601890afd80709" ...
765
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/SHA224.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA224") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "d14a028c2a3a2bc9476102bb288234c415a...
903
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/SHA256.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA256") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "e3b0c44298fc1c149afbf4c8996fb92427a...
947
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/SHA3.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA3") local SHA3_224_TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "6b4e03423667dbb73b6e15454f0eb1abd4...
2,764
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/SHA384.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA384") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "38b060a751ac96384cd9327eb1b1e36a21f...
1,204
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/SHA512.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: string } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/SHA2/SHA512") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = "cf83e1357eefb8bdf1542850d66d8007d62...
1,425
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/Simon.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Mode: "Encrypt" | "Decrypt", Description: string, Expected: string, Key: buffer?, Plaintext: string?, } type TestVectors = {[string]: TestVector} local function FromHex(Hex: string): buffer local Length = #Hex local Buffer = buffer.create(Length / 2)...
985
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/Speck.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Mode: "Encrypt" | "Decrypt", Description: string, Expected: string, Key: buffer?, Plaintext: string?, } type TestVectors = {[string]: TestVector} local function FromHex(Hex: string): buffer local Length = #Hex local Buffer = buffer.create(Length / 2)...
1,320
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/XOR.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Input: string, Key: string, } local function ToHex(Buffer: buffer) : string local Hex = "" for Index = 0, buffer.len(Buffer) - 1 do Hex ..= string.format("%02x", buffer.readu8(Buffer, Index)) end return Hex end local XOR = req...
1,144
daily3014/rbx-cryptography
daily3014-rbx-cryptography-6147c47/tests/XXH32.luau
luau
.luau
--!strict local Testing = require("./") type TestVector = { Description: string, Expected: number, Seed: number? } type TestVectors = {[string]: TestVector} local Algorithm = require("../Hashing/XXH32") local TestVectors: TestVectors = { [""] = { Description = "Empty String", Expected = 0x02cc5d05 }, ["abc"] = {...
985
Ultray-Studios/RBXConnectionManager
Ultray-Studios-RBXConnectionManager-18be690/RBXConnectionManager.luau
luau
.luau
local Players = game:GetService("Players") local RunService = game:GetService("RunService") local RBXConnectionManager = {} RBXConnectionManager.__index = RBXConnectionManager -- Constructor -- function RBXConnectionManager.new(monitoring_checker_interval: number?, osdate_format: string?) local self = setmetatable({}...
1,232
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/ci/RunTests.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) -- Run tests return Test.run({ ReplicatedStorage.Modules })
50
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/ci/Test.luau
luau
.luau
export type TestExpect = { Not: (self: TestExpect) -> TestExpect, ToBe: (self: TestExpect, value: any) -> (), ToBeNaN: (self: TestExpect, value: any) -> (), ToBeNil: (self: TestExpect) -> (), ToBeOk: (self: TestExpect) -> (), ToBeTruthy: (self: TestExpect) -> (), ToBeFalsy: (self: TestExpect) -> (), ToThrow: (s...
2,941
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/buffer-util/Buffer.test.luau
luau
.luau
local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) -- local BufferReader = require(script.Parent.BufferReader) -- local BufferWriter = require(script.Parent.BufferWriter) return function(ctx: Test.TestContext) ctx:Describe("Some test", functi...
191
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/buffer-util/BufferReader.luau
luau
.luau
--!native local BufferWriter = require(script.Parent.BufferWriter) local DataTypeBuffer = require(script.Parent.DataTypeBuffer) local Types = require(script.Parent.Types) --[=[ @class BufferReader A BufferReader is an abstraction wrapper for `buffer` objects that provides a convenient way of reading out data fro...
1,322
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/buffer-util/BufferWriter.luau
luau
.luau
--!native local MAX_SIZE = 1073741824 local DataTypeBuffer = require(script.Parent.DataTypeBuffer) local Types = require(script.Parent.Types) --[=[ @class BufferWriter A BufferWriter is an abstraction wrapper for `buffer` objects that provides a convenient way of writing data to buffers. The internal buffer i...
1,715
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/buffer-util/DataTypeBuffer.luau
luau
.luau
--!native local Types = require(script.Parent.Types) type ReadWritePair = { read: <T>(reader: Types.BufferReader) -> T, write: <T>(writer: Types.BufferWriter, value: T) -> (), } local DataTypeBuffer = {} DataTypeBuffer.DataTypesToString = { [BrickColor] = "BrickColor", [CFrame] = "CFrame", [Color3] = "Color3",...
1,732
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/buffer-util/Types.luau
luau
.luau
export type DataTypes = | BrickColor | CFrame | Color3 | DateTime | Ray | Rect | Region3 | Region3int16 | UDim | UDim2 | Vector2 | Vector3 | Vector2int16 | Vector3int16 export type BufferReader = { ReadInt8: (self: BufferReader) -> number, ReadUInt8: (self: BufferReader) -> number, ReadInt16: (self: B...
634
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/buffer-util/init.luau
luau
.luau
--!native local BufferReader = require(script.BufferReader) local BufferWriter = require(script.BufferWriter) --[=[ @class BufferUtil ]=] --[=[ @within BufferUtil @function reader @param buf buffer | string @return BufferReader Creates a BufferReader. The reader can be constructed from either a string or a `...
177
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/Client/ClientRemoteProperty.luau
luau
.luau
-- ClientRemoteProperty -- Stephen Leitnick -- December 20, 2021 local Promise = require(script.Parent.Parent.Parent.Promise) local Signal = require(script.Parent.Parent.Parent.Signal) local ClientRemoteSignal = require(script.Parent.ClientRemoteSignal) local Types = require(script.Parent.Parent.Types) --[=[ @within...
880
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/Client/ClientRemoteSignal.luau
luau
.luau
-- ClientRemoteSignal -- Stephen Leitnick -- December 20, 2021 local Signal = require(script.Parent.Parent.Parent.Signal) local Types = require(script.Parent.Parent.Types) --[=[ @class ClientRemoteSignal @client Created via `ClientComm:GetSignal()`. ]=] local ClientRemoteSignal = {} ClientRemoteSignal.__index = Cl...
668
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/Client/init.luau
luau
.luau
local Util = require(script.Parent.Util) local Types = require(script.Parent.Types) local Promise = require(script.Parent.Parent.Promise) local ClientRemoteSignal = require(script.ClientRemoteSignal) local ClientRemoteProperty = require(script.ClientRemoteProperty) local Client = {} function Client.GetFunction( pare...
1,018
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/Server/RemoteSignal.luau
luau
.luau
-- RemoteSignal -- Stephen Leitnick -- December 20, 2021 local Players = game:GetService("Players") local Signal = require(script.Parent.Parent.Parent.Signal) local Types = require(script.Parent.Parent.Types) --[=[ @class RemoteSignal @server Created via `ServerComm:CreateSignal()`. ]=] local RemoteSignal = {} Re...
1,375
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/Server/init.luau
luau
.luau
local RemoteProperty = require(script.RemoteProperty) local RemoteSignal = require(script.RemoteSignal) local Types = require(script.Parent.Types) local Util = require(script.Parent.Util) local Server = {} --[=[ @within Comm @prop ServerComm ServerComm ]=] --[=[ @within Comm @prop ClientComm ClientComm ]=] --[=[...
1,167
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/Types.luau
luau
.luau
-- Types -- Stephen Leitnick -- December 20, 2021 export type Args = { n: number, [any]: any, } export type FnBind = (Instance, ...any) -> ...any export type ServerMiddlewareFn = (Instance, Args) -> (boolean, ...any) export type ServerMiddleware = { ServerMiddlewareFn } export type ClientMiddlewareFn = (Args) -> ...
106
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/Util.luau
luau
.luau
local RunService = game:GetService("RunService") local Option = require(script.Parent.Parent.Option) local Util = {} Util.IsServer = RunService:IsServer() Util.WaitForChildTimeout = 60 Util.DefaultCommFolderName = "__comm__" Util.None = newproxy() function Util.GetCommSubFolder(parent: Instance, subFolderName: stri...
170
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/comm/init.luau
luau
.luau
-- Comm -- Stephen Leitnick -- August 05, 2021 --[=[ @class Comm Remote communication library. This exposes the raw functions that are used by the `ServerComm` and `ClientComm` classes. Those two classes should be preferred over accessing the functions directly through this Comm library. ```lua -- Server loc...
226
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/component/init.luau
luau
.luau
-- Component -- Stephen Leitnick -- November 26, 2021 type AncestorList = { Instance } --[=[ @type ExtensionFn (component) -> () @within Component ]=] type ExtensionFn = (any) -> () --[=[ @type ExtensionShouldFn (component) -> boolean @within Component ]=] type ExtensionShouldFn = (any) -> boolean --[=[ @inter...
4,958
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/component/init.test.luau
luau
.luau
local CollectionService = game:GetService("CollectionService") local RunService = game:GetService("RunService") local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) return function(ctx: Test.TestContext) local Component = require(script.Parent) ...
2,138
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/concur/init.luau
luau
.luau
--!strict -- Concur -- Stephen Leitnick -- May 01, 2022 type Error = any type AnyFn = (...any) -> ...any --[=[ @class Concur Concurrency class for helping run tasks concurrently. In other words, Concur allows developers to watch coroutines/threads. Completion status, returned values, and errors can all be track...
3,300
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/concur/init.test.luau
luau
.luau
local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) return function(ctx: Test.TestContext) local Concur = require(script.Parent) local function Awaiter(timeout: number) local awaiter = {} local thread local delayThread function awaite...
2,820
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/enum-list/init.luau
luau
.luau
-- EnumList -- Stephen Leitnick -- January 08, 2021 type EnumNames = { string } --[=[ @interface EnumItem .Name string .Value number .EnumType EnumList @within EnumList ]=] export type EnumItem = { Name: string, Value: number, EnumType: any, } local LIST_KEY = newproxy() local NAME_KEY = newproxy() local fu...
538
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/enum-list/init.test.luau
luau
.luau
local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) return function(ctx: Test.TestContext) local EnumList = require(script.Parent) ctx:Describe("Constructor", function() ctx:Test("should create a new enumlist", function() ctx:Expect(func...
730
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/find/init.luau
luau
.luau
--!strict --[=[ @class Find A utility function for finding objects in the data model hierarchy. Similar to `FindFirstChild`, except it explicitly errors if any object is not found, as well as a more helpful message as to what wasn't found. ```lua local find = require(ReplicatedStorage.Packages.find) -- Find...
306
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/input/Gamepad.luau
luau
.luau
-- Gamepad -- Stephen Leitnick -- December 23, 2021 local Signal = require(script.Parent.Parent.Signal) local Trove = require(script.Parent.Parent.Trove) local GuiService = game:GetService("GuiService") local HapticService = game:GetService("HapticService") local RunService = game:GetService("RunService") local UserI...
4,053
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/input/Keyboard.luau
luau
.luau
-- Keyboard -- Stephen Leitnick -- October 10, 2021 local Signal = require(script.Parent.Parent.Signal) local Trove = require(script.Parent.Parent.Trove) local UserInputService = game:GetService("UserInputService") --[=[ @class Keyboard @client The Keyboard class is part of the Input package. ```lua local Key...
693
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/input/Mouse.luau
luau
.luau
-- Mouse -- Stephen Leitnick -- November 07, 2020 local Signal = require(script.Parent.Parent.Signal) local Trove = require(script.Parent.Parent.Trove) local UserInputService = game:GetService("UserInputService") local RAY_DISTANCE = 1000 --[=[ @class Mouse @client The Mouse class is part of the Input package. ...
1,851
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/input/Touch.luau
luau
.luau
-- Touch -- Stephen Leitnick -- March 14, 2021 local Trove = require(script.Parent.Parent.Trove) local Signal = require(script.Parent.Parent.Signal) local UserInputService = game:GetService("UserInputService") --[=[ @class Touch @client The Touch class is part of the Input package. ```lua local Touch = requir...
1,107
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/input/init.luau
luau
.luau
-- Input -- Stephen Leitnick -- October 10, 2021 --[=[ @class Input The Input package provides access to various user input classes. - [PreferredInput](/api/PreferredInput) - [Mouse](/api/Mouse) - [Keyboard](/api/Keyboard) - [Touch](/api/Touch) - [Gamepad](/api/Gamepad) Reference the desired input modules v...
207
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/loader/init.luau
luau
.luau
--[=[ @class Loader The Loader module will require all children or descendant ModuleScripts. There are also some utility functions included, which assist with loading and starting modules in single-script environments. For example, here is a loader that loads all ModuleScripts under a folder that end with the n...
983
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/net/init.luau
luau
.luau
local RunService = game:GetService("RunService") --[=[ @class Net Basic networking module for creating and handling static RemoteEvents and RemoteFunctions. ]=] local Net = {} --[=[ Gets a RemoteEvent with the given name. On the server, if the RemoteEvent does not exist, then it will be created with the given ...
1,213
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/option/init.luau
luau
.luau
-- Option -- Stephen Leitnick -- August 28, 2020 --[[ MatchTable { Some: (value: any) -> any None: () -> any } CONSTRUCTORS: Option.Some(anyNonNilValue): Option<any> Option.Wrap(anyValue): Option<any> STATIC FIELDS: Option.None: Option<None> STATIC METHODS: Option.Is(obj): boolean METHODS:...
3,003
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/option/init.test.luau
luau
.luau
local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) return function(ctx: Test.TestContext) local Option = require(script.Parent) ctx:Describe("Some", function() ctx:Test("should create some option", function() local opt = Option.Some(tru...
2,660
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/pid/init.luau
luau
.luau
--!native export type PID = { Reset: (self: PID) -> (), Calculate: (self: PID, setpoint: number, input: number, deltaTime: number) -> number, Debug: (self: PID, name: string, parent: Instance?) -> (), Destroy: (self: PID) -> (), } --[=[ @class PID The PID class simulates a [PID controller](https://en.wikipedia....
1,390
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/quaternion/init.luau
luau
.luau
--!strict --[[ Algorithmic credit: https://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/index.htm ]] --[=[ @within Quaternion @interface Quaternion .X number .Y number .Z number .W number Similar to Vector3s, Quaternions are immutable. You cannot manually set the individual properties ...
4,508
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/query/init.luau
luau
.luau
--!strict --[=[ @class Query Adds helpful functions that wrap [`Instance:QueryDescendants()`](https://create.roblox.com/docs/reference/engine/classes/Instance#QueryDescendants). ]=] local Query = {} --[=[ @within Query Equivalent to [`parent:QueryDescendants(selector)`](https://create.roblox.com/docs/referenc...
713
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/sequent/init.luau
luau
.luau
export type Sequent<T> = { Fire: (self: Sequent<T>, T) -> (), Connect: (self: Sequent<T>, callback: (SequentEvent<T>) -> ()) -> SequentConnection, Once: (self: Sequent<T>, callback: (SequentEvent<T>) -> ()) -> SequentConnection, Cancel: (self: Sequent<T>) -> (), Destroy: (self: Sequent<T>) -> (), } --[=[ @interf...
1,886
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/ser/init.luau
luau
.luau
--!strict -- Ser -- Stephen Leitnick -- August 28, 2020 --[[ Ser is a serialization/deserialization utility module that is used by Knit to automatically serialize/deserialize values passing through remote functions and remote events. Ser.Classes = { [ClassName] = { Serialize = (value) -> serializedValue ...
947
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/ser/init.test.luau
luau
.luau
local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) return function(ctx: Test.TestContext) local Option = require(script.Parent.Parent.Option) local Ser = require(script.Parent) ctx:Describe("SerializeArgs", function() ctx:Test("should ser...
390
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/shake/init.test.luau
luau
.luau
local RunService = game:GetService("RunService") local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) local function AwaitStop(shake): number local start = os.clock() shake:Update() while shake:IsShaking() do task.wait() shake:Update() en...
2,312
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/silo/TableWatcher.luau
luau
.luau
--!strict -- TableWatcher -- Stephen Leitnick -- April 29, 2022 type AnyTable = { [any]: any } type Watcher = { Changes: AnyTable, Tbl: AnyTable, } local Util = require(script.Parent.Util) local watchers: { [TableWatcher]: Watcher } = {} setmetatable(watchers, { __mode = "k" }) local WatcherMt = {} function Wa...
328
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/silo/Util.luau
luau
.luau
--!strict -- Util -- Stephen Leitnick -- April 29, 2022 type AnyTable = { [any]: any } local Util = {} Util.None = newproxy() -- Recursive table freeze. function Util.DeepFreeze<T>(tbl: AnyTable): AnyTable table.freeze(tbl) for _, v in tbl do if type(v) == "table" then Util.DeepFreeze(v) end end return ...
311
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/silo/init.luau
luau
.luau
-- Silo -- Stephen Leitnick -- April 29, 2022 --[=[ @within Silo @type State<S> {[string]: any} Represents state. ]=] export type State<S> = S & { [string]: any } --[=[ @within Silo @type Modifier<S> (State<S>, any) -> () A function that modifies state. ]=] export type Modifier<S> = (State<S>, any) -> () --[=[...
2,227
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/silo/init.test.luau
luau
.luau
local ServerScriptService = game:GetService("ServerScriptService") local Test = require(ServerScriptService.TestRunner.Test) return function(ctx: Test.TestContext) local Silo = require(script.Parent) local silo1, silo2, rootSilo ctx:BeforeEach(function() silo1 = Silo.new({ Kills = 0, Deaths = 0, }, { ...
1,798
Sleitnick/RbxUtil
Sleitnick-RbxUtil-31f9120/modules/spring/init.luau
luau
.luau
--!strict --[=[ @class Spring Simulates a critically damped spring. This is mostly just a wrapper around [`TweenService:SmoothDamp()`](https://create.roblox.com/docs/reference/engine/classes/TweenService#SmoothDamp). ]=] local TweenService = game:GetService("TweenService") local Spring = {} Spring.__index = Spri...
582