@vandeurenglenn/base16 1.0.0 → 1.0.1

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A base16String only contains [0-9][a-f]
2
+ * A base16String only contains [0-9][A-F]
3
3
  */
4
4
  type base16String = string;
5
5
  export declare const decode: (source: string) => Uint8Array;
package/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import baseX from '@vandeurenglenn/base-x';
2
2
 
3
- const ALPHABET = '0123456789abcdef';
4
- const base32 = baseX(ALPHABET);
5
- const decode = base32.decode;
6
- const encode = base32.encode;
3
+ const ALPHABET = '0123456789ABCDEF';
4
+ const base16 = baseX(ALPHABET);
5
+ const decode = base16.decode;
6
+ const encode = base16.encode;
7
7
  const isBase16 = (string) => {
8
8
  try {
9
9
  decode(string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vandeurenglenn/base16",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Base16",
5
5
  "keywords": [
6
6
  "base",
package/src/index.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import baseX from '@vandeurenglenn/base-x'
2
2
 
3
3
  /**
4
- * A base16String only contains [0-9][a-f]
4
+ * A base16String only contains [0-9][A-F]
5
5
  */
6
6
  type base16String = string
7
7
 
8
- const ALPHABET = '0123456789abcdef'
8
+ const ALPHABET = '0123456789ABCDEF'
9
9
 
10
- const base32 = baseX(ALPHABET)
10
+ const base16 = baseX(ALPHABET)
11
11
 
12
- export const decode = base32.decode
12
+ export const decode = base16.decode
13
13
 
14
- export const encode = base32.encode
14
+ export const encode = base16.encode
15
15
 
16
16
  export const isBase16 = (string: base16String): boolean => {
17
17
  try {
package/tsconfig.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "moduleResolution":"NodeNext",
3
4
  "outDir": "./",
4
5
  "allowJs": true,
5
6
  "target": "es2022",
package/dist/base32.js DELETED
@@ -1,35 +0,0 @@
1
- import baseX from '@vandeurenglenn/base-x';
2
-
3
- const ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567';
4
- const ALPHABET_HEX = '0123456789abcdefghijklmnopqrstuv';
5
- const base32 = baseX(ALPHABET);
6
- const base32Hex = baseX(ALPHABET_HEX);
7
- const decode = base32.decode;
8
- const decodeHex = base32Hex.decode;
9
- const encode = base32.encode;
10
- const encodeHex = base32Hex.encode;
11
- const isBase32 = (string, hex = false) => {
12
- try {
13
- if (hex)
14
- decodeHex(string);
15
- else
16
- decode(string);
17
- return true;
18
- }
19
- catch (e) {
20
- return false;
21
- }
22
- };
23
- const isBase32Hex = (string) => {
24
- return isBase32(string, true);
25
- };
26
- var base32$1 = {
27
- encode,
28
- decode,
29
- encodeHex,
30
- decodeHex,
31
- isBase32,
32
- isBase32Hex
33
- };
34
-
35
- export { decode, decodeHex, base32$1 as default, encode, encodeHex, isBase32, isBase32Hex };