ciphers-gematria 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/calcul.d.ts +65 -0
- package/dist/calcul.js +91 -0
- package/dist/ciphers.d.ts +33 -0
- package/dist/ciphers.js +973 -0
- package/dist/index.d.ts +1 -0
- package/{src → dist}/index.js +1 -2
- package/dist/types/cipherFn.d.ts +1 -0
- package/dist/types/cipherFn.js +1 -0
- package/dist/types/table.d.ts +5 -0
- package/dist/types/table.js +1 -0
- package/package.json +12 -6
- package/src/calcul.js +0 -166
- package/src/ciphers.js +0 -781
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calcul.js';
|
package/{src → dist}/index.js
RENAMED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from './calcul.js';
|
|
2
|
-
|
|
1
|
+
export * from './calcul.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CipherFn = (text: string) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type LetterUpper = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
|
2
|
+
type LetterLower = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z';
|
|
3
|
+
export type Table = Record<LetterUpper, number>;
|
|
4
|
+
export type TableMixed = Record<LetterUpper | LetterLower, number>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ciphers-gematria",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "gematria calculator (Ordinal, Sumerian, Chaldean, Primes, etc.)",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"exports": {
|
|
8
|
-
".": "./
|
|
9
|
-
"./ciphers": "./
|
|
9
|
+
".": "./dist/index.js",
|
|
10
|
+
"./ciphers": "./dist/calcul.js"
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
12
|
-
"
|
|
13
|
+
"dist/",
|
|
13
14
|
"README.md",
|
|
14
15
|
"LICENSE.txt"
|
|
15
16
|
],
|
|
@@ -29,5 +30,10 @@
|
|
|
29
30
|
"homepage": "https://github.com/Samy572/ciphers-gematrie#readme",
|
|
30
31
|
"author": "Samy_ch",
|
|
31
32
|
"license": "MIT",
|
|
32
|
-
"
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc"
|
|
38
|
+
}
|
|
33
39
|
}
|
package/src/calcul.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
standardTable,
|
|
3
|
-
standardExtendedTable,
|
|
4
|
-
latinTable,
|
|
5
|
-
capitalsMixedTable,
|
|
6
|
-
reverseCapitalsMixedTable,
|
|
7
|
-
lowercaseTable,
|
|
8
|
-
uppercaseTable,
|
|
9
|
-
reverseStandardExtendedTable,
|
|
10
|
-
satanicTable,
|
|
11
|
-
reverseSatanicTable,
|
|
12
|
-
singleReductionTable,
|
|
13
|
-
kvExceptionTable,
|
|
14
|
-
skvExceptionTable,
|
|
15
|
-
reverseSingleReductionTable,
|
|
16
|
-
epExceptionTable,
|
|
17
|
-
ehpExceptionTable,
|
|
18
|
-
primesTable,
|
|
19
|
-
trigonalTable,
|
|
20
|
-
squaresTable,
|
|
21
|
-
fibonacciTable,
|
|
22
|
-
reversePrimesTable,
|
|
23
|
-
reverseTrigonalTable,
|
|
24
|
-
septenaryTable,
|
|
25
|
-
reverseSquaresTable,
|
|
26
|
-
chaldeanTable,
|
|
27
|
-
keypadTable,
|
|
28
|
-
} from './ciphers.js';
|
|
29
|
-
|
|
30
|
-
// Reverse Standard
|
|
31
|
-
const reverseTable = {};
|
|
32
|
-
for (const [letter, value] of Object.entries(standardTable)) {
|
|
33
|
-
reverseTable[letter] = 27 - value;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Sumerian (Ordinal * 6)
|
|
37
|
-
const sumerianTable = {};
|
|
38
|
-
for (const [letter, value] of Object.entries(standardTable)) {
|
|
39
|
-
sumerianTable[letter] = value * 6;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Reverse Sumerian (Reverse * 6)
|
|
43
|
-
const reverseSumerianTable = {};
|
|
44
|
-
for (const [letter, value] of Object.entries(reverseTable)) {
|
|
45
|
-
reverseSumerianTable[letter] = value * 6;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Helper to clean text
|
|
49
|
-
function cleanText(text) {
|
|
50
|
-
return text.toUpperCase().replace(/[^A-Z]/g, '');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Reduce number
|
|
54
|
-
function reduceNumber(n) {
|
|
55
|
-
return ((n - 1) % 9) + 1;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Calculate value
|
|
59
|
-
function calcValue(text, table, reduce = false) {
|
|
60
|
-
const letters = cleanText(text).split('');
|
|
61
|
-
let sum = 0;
|
|
62
|
-
for (const char of letters) {
|
|
63
|
-
let val = table[char] || 0;
|
|
64
|
-
if (reduce) val = reduceNumber(val);
|
|
65
|
-
sum += val;
|
|
66
|
-
}
|
|
67
|
-
return sum;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Capital added
|
|
71
|
-
function capitalsAdded(text) {
|
|
72
|
-
let sum = 0;
|
|
73
|
-
|
|
74
|
-
for (const char of text) {
|
|
75
|
-
if (lowercaseTable[char]) {
|
|
76
|
-
sum += lowercaseTable[char];
|
|
77
|
-
} else if (uppercaseTable[char]) {
|
|
78
|
-
sum += uppercaseTable[char];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return sum;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export const ordinal = (text) => calcValue(text, standardTable);
|
|
85
|
-
export const reduction = (text) => calcValue(text, standardTable, true);
|
|
86
|
-
|
|
87
|
-
export const reverseOrdinal = (text) => calcValue(text, reverseTable);
|
|
88
|
-
|
|
89
|
-
export const reverseReduction = (text) => calcValue(text, reverseTable, true);
|
|
90
|
-
|
|
91
|
-
export const standard = (text) => calcValue(text, standardExtendedTable);
|
|
92
|
-
export const latin = (text) => calcValue(text, latinTable);
|
|
93
|
-
export const sumerian = (text) => calcValue(text, sumerianTable);
|
|
94
|
-
export const reverseSumerian = (text) => calcValue(text, reverseSumerianTable);
|
|
95
|
-
|
|
96
|
-
export const capitalsMixed = (text) => calcValue(text, capitalsMixedTable);
|
|
97
|
-
export const capitalsAdd = (text) => capitalsAdded(text);
|
|
98
|
-
export const reverseCapsMixed = (text) =>
|
|
99
|
-
calcValue(text, reverseCapitalsMixedTable);
|
|
100
|
-
export const reverseCapsAdded = (text) => calcValue(text, reverseTable);
|
|
101
|
-
|
|
102
|
-
export const reverseStandard = (text) =>
|
|
103
|
-
calcValue(text, reverseStandardExtendedTable);
|
|
104
|
-
export const satanic = (text) => calcValue(text, satanicTable);
|
|
105
|
-
export const reverseSatanic = (text) => calcValue(text, reverseSatanicTable);
|
|
106
|
-
export const singleReduction = (text) => calcValue(text, singleReductionTable);
|
|
107
|
-
|
|
108
|
-
export const kvException = (text) => calcValue(text, kvExceptionTable);
|
|
109
|
-
export const skvException = (text) => calcValue(text, skvExceptionTable);
|
|
110
|
-
export const reverseSingleReduction = (text) =>
|
|
111
|
-
calcValue(text, reverseSingleReductionTable);
|
|
112
|
-
export const epException = (text) => calcValue(text, epExceptionTable);
|
|
113
|
-
export const ehpException = (text) => calcValue(text, ehpExceptionTable);
|
|
114
|
-
export const primes = (text) => calcValue(text, primesTable);
|
|
115
|
-
export const trigonal = (text) => calcValue(text, trigonalTable);
|
|
116
|
-
export const squares = (text) => calcValue(text, squaresTable);
|
|
117
|
-
export const fibonacci = (text) => calcValue(text, fibonacciTable);
|
|
118
|
-
export const reversePrimes = (text) => calcValue(text, reversePrimesTable);
|
|
119
|
-
export const reverseTrigonal = (text) => calcValue(text, reverseTrigonalTable);
|
|
120
|
-
export const septenary = (text) => calcValue(text, septenaryTable);
|
|
121
|
-
export const reverseSquares = (text) => calcValue(text, reverseSquaresTable);
|
|
122
|
-
export const chaldean = (text) => calcValue(text, chaldeanTable);
|
|
123
|
-
export const keypad = (text) => calcValue(text, keypadTable);
|
|
124
|
-
|
|
125
|
-
export function ciphers(text) {
|
|
126
|
-
return {
|
|
127
|
-
Ordinal: ordinal(text),
|
|
128
|
-
Reduction: reduction(text),
|
|
129
|
-
ReverseOrdinal: reverseOrdinal(text),
|
|
130
|
-
ReverseReduction: reverseReduction(text),
|
|
131
|
-
|
|
132
|
-
Standard: standard(text),
|
|
133
|
-
Latin: latin(text),
|
|
134
|
-
Sumerian: sumerian(text),
|
|
135
|
-
ReverseSumerian: reverseSumerian(text),
|
|
136
|
-
|
|
137
|
-
CapitalsMixed: capitalsMixed(text),
|
|
138
|
-
CapitalsAdded: capitalsAdd(text),
|
|
139
|
-
ReverseCapsMixed: reverseCapsMixed(text),
|
|
140
|
-
ReverseCapsAdded: reverseCapsAdded(text),
|
|
141
|
-
|
|
142
|
-
ReverseStandard: reverseStandard(text),
|
|
143
|
-
Satanic: satanic(text),
|
|
144
|
-
ReverseSatanic: reverseSatanic(text),
|
|
145
|
-
SingleReduction: singleReduction(text),
|
|
146
|
-
|
|
147
|
-
KvException: kvException(text),
|
|
148
|
-
SkvException: skvException(text),
|
|
149
|
-
ReverseSingleReduction: reverseSingleReduction(text),
|
|
150
|
-
EpException: epException(text),
|
|
151
|
-
|
|
152
|
-
EhpException: ehpException(text),
|
|
153
|
-
Primes: primes(text),
|
|
154
|
-
Trigonal: trigonal(text),
|
|
155
|
-
Squares: squares(text),
|
|
156
|
-
|
|
157
|
-
Fibonacci: fibonacci(text),
|
|
158
|
-
ReversePrimes: reversePrimes(text),
|
|
159
|
-
ReverseTrigonal: reverseTrigonal(text),
|
|
160
|
-
|
|
161
|
-
ReverseSquares: reverseSquares(text),
|
|
162
|
-
Chaldean: chaldean(text),
|
|
163
|
-
Septenary: septenary(text),
|
|
164
|
-
Keypad: keypad(text),
|
|
165
|
-
};
|
|
166
|
-
}
|