Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const fs = require('fs');

/**
* Generates a unique chaotic identifier.
* "A fragment of an ancient seal... randomized across dimensions."
*/
function casperId(num = 4) {
let result = "";
let characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
Expand All @@ -10,6 +14,10 @@ function casperId(num = 4) {
return result;
}

/**
* Extracts a cold, 8-digit sync sequence for the client matrix.
* "The keys to the binding ritual..."
*/
function generateRandomCode() {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
let result = '';
Expand All @@ -19,6 +27,10 @@ function generateRandomCode() {
return result;
}

/**
* Erases traces of temporary artifacts from existence.
* "Leave no evidence behind. Purge the directory."
*/
async function removeFile(FilePath) {
if (!fs.existsSync(FilePath)) return false;
await fs.promises.rm(FilePath, { recursive: true, force: true });
Expand Down