feat(core): initialize hyperstitionstudio-core (hyperstitionstud_io.* / urn:io:hyperstitionstud:*) shared library, 4897-entry offline CMUdict fallback, local-config citation resolver, CLI entrypoints, and test suite (v1.2.0)
This commit is contained in:
commit
f8235a2037
32 files changed
+6646
No files matched your search
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @hyperstitionstud.io/ciphers-aq (urn:io:hyperstitionstud:js:ciphers-aq:1.2.0)
|
||||
* 100% Offline Base-36 Alphanumeric Qabbala (AQ) & Repdigit Evaluator for Browser (file:// & http://) and Node ESM.
|
||||
*/
|
||||
|
||||
export function computeAQ(text) {
|
||||
let total = 0;
|
||||
const s = String(text || "").toLowerCase();
|
||||
for (let i = 0; i < s.length; i++) {
|
||||
const code = s.charCodeAt(i);
|
||||
if (code >= 48 && code <= 57) {
|
||||
total += code - 48;
|
||||
} else if (code >= 97 && code <= 122) {
|
||||
total += code - 87;
|
||||
}
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
export function isRepdigit37(n) {
|
||||
return n > 0 && n % 111 === 0;
|
||||
}
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
window.HyperstitionStudio = window.HyperstitionStudio || {};
|
||||
window.HyperstitionStudio.Ciphers = { computeAQ, isRepdigit37 };
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "@hyperstitionstud.io/ciphers-aq",
|
||||
"version": "1.2.0",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"license": "MIT"
|
||||
}
|
||||
Reference in new issue
Block a user