@utilix-tech/sdk 0.38.0 → 0.40.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/CHANGELOG.md +8 -0
- package/README.md +25 -5
- package/dist/{chunk-47RI5V3B.js → chunk-2MTHD2LG.js} +62 -1
- package/dist/{chunk-GEFVMGZR.js → chunk-PET2CGTH.js} +46 -1
- package/dist/{chunk-DBNTO3YO.js → chunk-Y4BVU76A.js} +80 -1
- package/dist/hashing-CJjlvqS_.d.cts +127 -0
- package/dist/hashing-CJjlvqS_.d.ts +127 -0
- package/dist/index.cjs +185 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{network-CnKUQT4g.d.cts → network-CKPoesdD.d.cts} +52 -2
- package/dist/{network-CnKUQT4g.d.ts → network-CKPoesdD.d.ts} +52 -2
- package/dist/tools/hashing.cjs +45 -0
- package/dist/tools/hashing.d.cts +1 -1
- package/dist/tools/hashing.d.ts +1 -1
- package/dist/tools/hashing.js +1 -1
- package/dist/tools/network.cjs +79 -0
- package/dist/tools/network.d.cts +1 -1
- package/dist/tools/network.d.ts +1 -1
- package/dist/tools/network.js +1 -1
- package/dist/tools/units.cjs +61 -0
- package/dist/tools/units.d.cts +1 -1
- package/dist/tools/units.d.ts +1 -1
- package/dist/tools/units.js +1 -1
- package/dist/{units-HQrMCiNM.d.cts → units-CzPwRC03.d.cts} +50 -2
- package/dist/{units-HQrMCiNM.d.ts → units-CzPwRC03.d.ts} +50 -2
- package/package.json +1 -1
- package/dist/hashing-CnetQFD_.d.cts +0 -76
- package/dist/hashing-CnetQFD_.d.ts +0 -76
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @utilix/sdk — hashing module
|
|
3
|
-
*
|
|
4
|
-
* Tools covered:
|
|
5
|
-
* - hash-generator : hashAll, hashOne (MD5, SHA-1, SHA-256, SHA-384, SHA-512)
|
|
6
|
-
* - bcrypt-tool : hashPassword, verifyPassword, hashWithTiming, validateRounds
|
|
7
|
-
* - htpasswd : generateSha1Hash, generateMd5Hash, generateBcryptHash,
|
|
8
|
-
* generatePlain, createEntry, parseHtpasswdFile,
|
|
9
|
-
* generateHtpasswdFile, validateUsername
|
|
10
|
-
*/
|
|
11
|
-
type HashAlgorithm = 'MD5' | 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';
|
|
12
|
-
declare const HASH_ALGORITHMS: HashAlgorithm[];
|
|
13
|
-
declare const HASH_BITS: Record<HashAlgorithm, number>;
|
|
14
|
-
interface HashResult {
|
|
15
|
-
algorithm: HashAlgorithm;
|
|
16
|
-
hex: string;
|
|
17
|
-
bits: number;
|
|
18
|
-
}
|
|
19
|
-
declare function hashAll(input: string): Promise<HashResult[]>;
|
|
20
|
-
declare function hashOne(algorithm: HashAlgorithm, input: string): Promise<string>;
|
|
21
|
-
declare const ROUND_OPTIONS: readonly [8, 10, 12, 14];
|
|
22
|
-
declare function hashPassword(password: string, rounds?: number): Promise<string>;
|
|
23
|
-
declare function verifyPassword(password: string, hash: string): Promise<boolean>;
|
|
24
|
-
interface BcryptResult {
|
|
25
|
-
hash: string;
|
|
26
|
-
rounds: number;
|
|
27
|
-
timingMs: number;
|
|
28
|
-
}
|
|
29
|
-
declare function hashWithTiming(password: string, rounds: number): Promise<BcryptResult>;
|
|
30
|
-
declare function validateRounds(rounds: number): {
|
|
31
|
-
valid: boolean;
|
|
32
|
-
warning?: string;
|
|
33
|
-
};
|
|
34
|
-
type HtpasswdAlgorithm = 'bcrypt' | 'sha1' | 'md5' | 'plain';
|
|
35
|
-
interface HtpasswdEntry {
|
|
36
|
-
username: string;
|
|
37
|
-
hashedPassword: string;
|
|
38
|
-
algorithm: HtpasswdAlgorithm;
|
|
39
|
-
line: string;
|
|
40
|
-
}
|
|
41
|
-
declare function generateSha1Hash(password: string): string;
|
|
42
|
-
declare function generateMd5Hash(password: string): string;
|
|
43
|
-
declare function generateBcryptHash(password: string, rounds?: number): string;
|
|
44
|
-
declare function generatePlain(password: string): string;
|
|
45
|
-
declare function createEntry(username: string, password: string, algorithm?: HtpasswdAlgorithm): HtpasswdEntry;
|
|
46
|
-
declare function parseHtpasswdFile(content: string): HtpasswdEntry[];
|
|
47
|
-
declare function generateHtpasswdFile(entries: HtpasswdEntry[]): string;
|
|
48
|
-
declare function validateUsername(username: string): boolean;
|
|
49
|
-
|
|
50
|
-
type hashing_BcryptResult = BcryptResult;
|
|
51
|
-
declare const hashing_HASH_ALGORITHMS: typeof HASH_ALGORITHMS;
|
|
52
|
-
declare const hashing_HASH_BITS: typeof HASH_BITS;
|
|
53
|
-
type hashing_HashAlgorithm = HashAlgorithm;
|
|
54
|
-
type hashing_HashResult = HashResult;
|
|
55
|
-
type hashing_HtpasswdAlgorithm = HtpasswdAlgorithm;
|
|
56
|
-
type hashing_HtpasswdEntry = HtpasswdEntry;
|
|
57
|
-
declare const hashing_ROUND_OPTIONS: typeof ROUND_OPTIONS;
|
|
58
|
-
declare const hashing_createEntry: typeof createEntry;
|
|
59
|
-
declare const hashing_generateBcryptHash: typeof generateBcryptHash;
|
|
60
|
-
declare const hashing_generateHtpasswdFile: typeof generateHtpasswdFile;
|
|
61
|
-
declare const hashing_generateMd5Hash: typeof generateMd5Hash;
|
|
62
|
-
declare const hashing_generatePlain: typeof generatePlain;
|
|
63
|
-
declare const hashing_generateSha1Hash: typeof generateSha1Hash;
|
|
64
|
-
declare const hashing_hashAll: typeof hashAll;
|
|
65
|
-
declare const hashing_hashOne: typeof hashOne;
|
|
66
|
-
declare const hashing_hashPassword: typeof hashPassword;
|
|
67
|
-
declare const hashing_hashWithTiming: typeof hashWithTiming;
|
|
68
|
-
declare const hashing_parseHtpasswdFile: typeof parseHtpasswdFile;
|
|
69
|
-
declare const hashing_validateRounds: typeof validateRounds;
|
|
70
|
-
declare const hashing_validateUsername: typeof validateUsername;
|
|
71
|
-
declare const hashing_verifyPassword: typeof verifyPassword;
|
|
72
|
-
declare namespace hashing {
|
|
73
|
-
export { type hashing_BcryptResult as BcryptResult, hashing_HASH_ALGORITHMS as HASH_ALGORITHMS, hashing_HASH_BITS as HASH_BITS, type hashing_HashAlgorithm as HashAlgorithm, type hashing_HashResult as HashResult, type hashing_HtpasswdAlgorithm as HtpasswdAlgorithm, type hashing_HtpasswdEntry as HtpasswdEntry, hashing_ROUND_OPTIONS as ROUND_OPTIONS, hashing_createEntry as createEntry, hashing_generateBcryptHash as generateBcryptHash, hashing_generateHtpasswdFile as generateHtpasswdFile, hashing_generateMd5Hash as generateMd5Hash, hashing_generatePlain as generatePlain, hashing_generateSha1Hash as generateSha1Hash, hashing_hashAll as hashAll, hashing_hashOne as hashOne, hashing_hashPassword as hashPassword, hashing_hashWithTiming as hashWithTiming, hashing_parseHtpasswdFile as parseHtpasswdFile, hashing_validateRounds as validateRounds, hashing_validateUsername as validateUsername, hashing_verifyPassword as verifyPassword };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export { type BcryptResult as B, HASH_ALGORITHMS as H, ROUND_OPTIONS as R, HASH_BITS as a, type HashAlgorithm as b, type HashResult as c, type HtpasswdAlgorithm as d, type HtpasswdEntry as e, createEntry as f, generateBcryptHash as g, hashing as h, generateHtpasswdFile as i, generateMd5Hash as j, generatePlain as k, generateSha1Hash as l, hashAll as m, hashOne as n, hashPassword as o, hashWithTiming as p, parseHtpasswdFile as q, validateUsername as r, verifyPassword as s, validateRounds as v };
|