API Reference
Detailed specifications for the core methods exposed by the StickCode library.
async .init(licenseInput)
Initializes the crypt-engine asynchronously, evaluates structural integrity, and validates the hardware node fingerprint against the licensing cloud endpoint.
licenseInput(String | Object): A valid JSON object or a parsed equivalent string containing the signed license data (payload and signature).
// Example usage
await StickCode.init({
payload: "eyJs...In0=",
signature: "MEQCID..."
});
.encrypt(text, option)
Compresses the input text string using architectural Brotli specifications and returns a raw, hardened binary allocation (Buffer).
text(String): The raw data target intended for storage or networking.option(Boolean / Optional):- Omitted (Default): Deploys full secure mode, scrambling the data via an advanced 256-bit GCM cipher layout with dynamic polymorph metrics.
true(Optimized Mode): Bypasses encryption entirely, routing the buffer strictly through Brotli compression and semantic color mapping to avoid data bloat on hashed components.
// 1. Standard Secure Processing (AES-256-GCM Layout)
const secureBuffer = StickCode.encrypt("Sensitive Information");
// 2. Storage Optimized Processing (Compression Only)
const compressedBuffer = StickCode.encrypt("AlreadySecureHash", true);
.decrypt(buffer)
Parses internal byte-markers out of the provided buffer allocations, automatically unpacking encryption envelopes and unrolling compression states to return original string states.
buffer(Buffer): The binary buffer output generated from a matching.encrypt()transaction.
// Decodes both Secure and Optimized binary assets automatically
const originalText = StickCode.decrypt(encryptedBuffer);
.resetDevices()
Purges the local caching registry file
(.device_registry) from the project directory. This triggers a full re-verification
cycle on the subsequent .init() invocation.
// Clear local cache token
StickCode.resetDevices();