ciphers-gematria 1.0.3 → 2.0.0

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/README.md CHANGED
@@ -13,12 +13,15 @@ npm install ciphers-gematria
13
13
  yarn add ciphers-gematria
14
14
  ```
15
15
 
16
- ## Calculate all ciphers
16
+ ## Quick start
17
17
 
18
18
  ```javascript
19
- import { ciphers } from 'ciphers-gematria';
19
+ import { ciphers } from 'ciphers-gematria'; // ESM
20
+ const gematria = require('ciphers-gematria'); // CJS
21
+
22
+ const result = ciphers("hello"); // ESM
23
+ const result = gematria.ciphers("hello"); // CJS
20
24
 
21
- const result = ciphers("hello");
22
25
  console.log(result);
23
26
 
24
27
  // Output:
@@ -60,17 +63,108 @@ console.log(result);
60
63
  ---
61
64
 
62
65
  ## Calculate a single cipher
63
-
66
+ ### ESM
67
+ ♻️ Only the imported cipher will be included in your final bundle.
64
68
  ```javascript
65
- import { sumerian, chaldean } from 'ciphers-gematria';
69
+ import { sumerian, latin, chaldean } from 'ciphers-gematria';
66
70
 
67
71
  console.log(sumerian('hello')); // 312
68
- console.log(chaldean('hello')); // 23
72
+ console.log(gematria.chaldean('hello')); // 23
73
+ ```
74
+
75
+ ### CJS
76
+ ```javascript
77
+ const gematria = require('ciphers-gematria');
78
+
79
+ console.log(gematria.latin('hello')); // 312
80
+ console.log(gematria.chaldean('hello')); // 23
69
81
  ```
70
82
 
71
83
  ---
72
- ## 🤝Contribution
84
+ ## 🛠️ Create a custom cipher
85
+
86
+ createCipher is a function:
87
+ it returns a new cipher function based on a custom letter-value table.
88
+
89
+ ### ESM
90
+ ```javascript
91
+ import { createCipher } from 'ciphers-gematria';
92
+
93
+ const mySpecialTable = {
94
+ A: 251, B: 101, C: 45, D:150 ...... Z:42
95
+ };
96
+ const myCustomCipher = createCipher(mySpecialTable);
97
+ console.log(myCustomCipher('hello'));
98
+
99
+ ```
100
+ ### CJS
101
+ ```javascript
102
+ const gematria = require('ciphers-gematria');
103
+
104
+ const mySpecialTable = {
105
+ A: 251, B: 101, C: 45, D:150 ...... Z:42
106
+ };
107
+ const myCustomCipher = gematria.createCipher(mySpecialTable);
108
+ console.log(myCustomCipher('hello'));
109
+ ```
110
+
111
+ ---
112
+ ## 📚 Available ciphers
113
+
114
+ <table style="background-color: #f1f1f1; border-radius: 5px; padding: 5px">
115
+ <tr s>
116
+ <td >Ordinal</td>
117
+ <td >Reduction</td>
118
+ <td >Reverse</td>
119
+ <td >Reverse Reduction</td>
120
+ </tr>
121
+ <tr>
122
+ <td>Standard</td>
123
+ <td >Latin</td>
124
+ <td >Sumerian</td>
125
+ <td >Reverse Sumerian</td>
126
+ </tr>
127
+ <tr>
128
+ <td>Capitals Mixed</td>
129
+ <td >Capitals Added</td>
130
+ <td >Reverse Capitals Mixed</td>
131
+ <td >Reverse Capitals Added</td>
132
+ </tr>
133
+ <tr>
134
+ <td>Reverse Standard</td>
135
+ <td >Satanic</td>
136
+ <td >Reverse Satanic</td>
137
+ <td >Single Reduction</td>
138
+ </tr>
139
+ <tr>
140
+ <td>Kv Exception</td>
141
+ <td >Skv Exception</td>
142
+ <td >Reverse Single Reduction</td>
143
+ <td >Ep Exception</td>
144
+ </tr>
145
+ <tr>
146
+ <td>Ehp Exception</td>
147
+ <td >Primes</td>
148
+ <td >Trigonal</td>
149
+ <td >Squares</td>
150
+ </tr>
151
+ <tr>
152
+ <td>Fibonacci</td>
153
+ <td >Reverse Primes</td>
154
+ <td >Reverse Trigonal</td>
155
+ <td >Reverse Squares</td>
156
+ </tr>
157
+ <tr>
158
+ <td>Chaldean</td>
159
+ <td >Septenary</td>
160
+ <td >Keypad</td>
161
+ </tr>
162
+ </table>
163
+
164
+ ---
165
+ ### 🤝Contribution
73
166
 
74
167
  Contributions are welcome! If you’d like to add a new cipher.
75
168
 
76
- Fork the repository and create a pull request.
169
+ Fork the repository and create a pull request
170
+