pythonlib 1.0.1 → 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 +3 -1
- package/dist/base64-C_am75Sv.d.ts +165 -0
- package/dist/base64.d.ts +1 -0
- package/dist/base64.js +37 -0
- package/dist/chunk-2YTO24B5.js +78 -0
- package/dist/chunk-3CLXPGAB.js +237 -0
- package/dist/{chunk-H76SKASU.js → chunk-3M3PB4RO.js} +4 -6
- package/dist/chunk-5OKGPZBQ.js +1106 -0
- package/dist/chunk-5VAHUJNC.js +348 -0
- package/dist/chunk-B5AUEOAH.js +193 -0
- package/dist/chunk-B5LQJODJ.js +37 -0
- package/dist/{chunk-HQ42WNKZ.js → chunk-BCMGGBWG.js} +2 -5
- package/dist/chunk-BCVIH2BN.js +175 -0
- package/dist/{chunk-EE7SK2GV.js → chunk-D35YI363.js} +15 -12
- package/dist/{chunk-7TH4FCVQ.js → chunk-ETBW6XNR.js} +3 -4
- package/dist/chunk-FCJ7E4OE.js +250 -0
- package/dist/chunk-HSTC277I.js +255 -0
- package/dist/chunk-IANXD4D4.js +250 -0
- package/dist/{chunk-4KYJT3DR.js → chunk-JAUU3HMH.js} +1 -2
- package/dist/chunk-JJKTRIVO.js +262 -0
- package/dist/chunk-KKHKTQNN.js +361 -0
- package/dist/chunk-KKJHGY4C.js +551 -0
- package/dist/chunk-LHPQS75Z.js +192 -0
- package/dist/{chunk-LWO6BIAD.js → chunk-LK2L2TFG.js} +5 -6
- package/dist/chunk-LLZFLQS6.js +280 -0
- package/dist/chunk-LTXTS7RP.js +154 -0
- package/dist/{chunk-4QG3772L.js → chunk-LWYBTWBZ.js} +2 -3
- package/dist/{chunk-6ZAJ37MR.js → chunk-MFKIEN7N.js} +3 -3
- package/dist/{chunk-PZ5AY32C.js → chunk-MLKGABMK.js} +0 -1
- package/dist/chunk-OZRS5PC4.js +312 -0
- package/dist/chunk-PWA3YQZU.js +346 -0
- package/dist/{chunk-6POEDI34.js → chunk-QKJBQKPY.js} +1 -2
- package/dist/chunk-RB6BYCIQ.js +141 -0
- package/dist/chunk-U4X5DEIP.js +188 -0
- package/dist/chunk-UGZ5OY5Z.js +165 -0
- package/dist/chunk-WTZSAITC.js +82 -0
- package/dist/{collections-CJur5Wg-.d.ts → collections-BthXtkEp.d.ts} +5 -1
- package/dist/collections.d.ts +1 -1
- package/dist/collections.js +2 -3
- package/dist/copy-6ZaZ__ge.d.ts +59 -0
- package/dist/copy.d.ts +1 -0
- package/dist/copy.js +9 -0
- package/dist/{datetime-Bpce8gG2.d.ts → datetime-BM_IjhTq.d.ts} +3 -1
- package/dist/datetime.d.ts +1 -1
- package/dist/datetime.js +2 -3
- package/dist/{functools-NrsZAqJk.d.ts → functools-uIa5g75p.d.ts} +3 -1
- package/dist/functools.d.ts +1 -1
- package/dist/functools.js +2 -3
- package/dist/glob.browser-B6d_YdV5.d.ts +50 -0
- package/dist/glob.browser.d.ts +1 -0
- package/dist/glob.browser.js +15 -0
- package/dist/glob.node-wn5ehtyM.d.ts +80 -0
- package/dist/glob.node.d.ts +1 -0
- package/dist/glob.node.js +15 -0
- package/dist/hashlib-vKP511NY.d.ts +205 -0
- package/dist/hashlib.d.ts +1 -0
- package/dist/hashlib.js +39 -0
- package/dist/index.browser.d.ts +172 -0
- package/dist/index.browser.js +304 -0
- package/dist/index.d.ts +61 -437
- package/dist/index.js +138 -1115
- package/dist/{itertools-Sjl1LB_0.d.ts → itertools-T0rwOk2j.d.ts} +2 -4
- package/dist/itertools.d.ts +1 -1
- package/dist/itertools.js +2 -3
- package/dist/{json-DAlvCadU.d.ts → json-DoWhX04T.d.ts} +1 -0
- package/dist/json.d.ts +1 -1
- package/dist/json.js +2 -3
- package/dist/logging.browser-Dux4L5kz.d.ts +185 -0
- package/dist/logging.browser.d.ts +1 -0
- package/dist/logging.browser.js +63 -0
- package/dist/logging.node-CH75bVdE.d.ts +185 -0
- package/dist/logging.node.d.ts +1 -0
- package/dist/logging.node.js +61 -0
- package/dist/{math-DwEGjjQ-.d.ts → math-D2NPMc-x.d.ts} +2 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +2 -3
- package/dist/{os-C6Nt7Ijx.d.ts → os.browser-krjSx5kF.d.ts} +32 -54
- package/dist/os.browser.d.ts +2 -0
- package/dist/{os.js → os.browser.js} +41 -16
- package/dist/os.node-CQjch8Ht.d.ts +124 -0
- package/dist/os.node.d.ts +2 -0
- package/dist/os.node.js +83 -0
- package/dist/os.shared-C3x70nhO.d.ts +59 -0
- package/dist/pathlib.browser-NC7kKQYe.d.ts +91 -0
- package/dist/pathlib.browser.d.ts +1 -0
- package/dist/pathlib.browser.js +17 -0
- package/dist/pathlib.node-CY3yUFdT.d.ts +331 -0
- package/dist/pathlib.node.d.ts +2 -0
- package/dist/pathlib.node.js +17 -0
- package/dist/{random-BJv_rSpL.d.ts → random-DcS5jtEs.d.ts} +3 -5
- package/dist/random.d.ts +1 -1
- package/dist/random.js +2 -3
- package/dist/{re-B1CHCgyr.d.ts → re-Bo-IOqov.d.ts} +3 -7
- package/dist/re.d.ts +1 -1
- package/dist/re.js +2 -3
- package/dist/set-JQbLAq8B.d.ts +592 -0
- package/dist/shutil.browser-Ck5oWhnP.d.ts +113 -0
- package/dist/shutil.browser.d.ts +1 -0
- package/dist/shutil.browser.js +33 -0
- package/dist/shutil.node-C9kwvhAf.d.ts +160 -0
- package/dist/shutil.node.d.ts +2 -0
- package/dist/shutil.node.js +33 -0
- package/dist/string.d.ts +3 -1
- package/dist/string.js +2 -3
- package/dist/subprocess-CZVYzQ3V.d.ts +214 -0
- package/dist/subprocess.d.ts +1 -0
- package/dist/subprocess.js +29 -0
- package/dist/sys-IL8LgI_W.d.ts +212 -0
- package/dist/sys.d.ts +1 -0
- package/dist/sys.js +51 -0
- package/dist/tempfile.browser-DciOKfNm.d.ts +78 -0
- package/dist/tempfile.browser.d.ts +1 -0
- package/dist/tempfile.browser.js +19 -0
- package/dist/tempfile.node-bVMY60Cu.d.ts +195 -0
- package/dist/tempfile.node.d.ts +2 -0
- package/dist/tempfile.node.js +23 -0
- package/dist/time-CcYhdiSu.d.ts +245 -0
- package/dist/time.d.ts +1 -0
- package/dist/time.js +49 -0
- package/dist/urllib-DJtkj-0f.d.ts +198 -0
- package/dist/urllib.d.ts +1 -0
- package/dist/urllib.js +37 -0
- package/dist/uuid-C0ypmn56.d.ts +160 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +23 -0
- package/package.json +127 -5
- package/dist/chunk-4KYJT3DR.js.map +0 -1
- package/dist/chunk-4QG3772L.js.map +0 -1
- package/dist/chunk-6POEDI34.js.map +0 -1
- package/dist/chunk-6ZAJ37MR.js.map +0 -1
- package/dist/chunk-7TH4FCVQ.js.map +0 -1
- package/dist/chunk-CXKGPD5D.js +0 -313
- package/dist/chunk-CXKGPD5D.js.map +0 -1
- package/dist/chunk-EE7SK2GV.js.map +0 -1
- package/dist/chunk-H76SKASU.js.map +0 -1
- package/dist/chunk-HQ42WNKZ.js.map +0 -1
- package/dist/chunk-LWO6BIAD.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/collections.js.map +0 -1
- package/dist/datetime.js.map +0 -1
- package/dist/functools.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/itertools.js.map +0 -1
- package/dist/json.js.map +0 -1
- package/dist/math.js.map +0 -1
- package/dist/os.d.ts +0 -1
- package/dist/os.js.map +0 -1
- package/dist/random.js.map +0 -1
- package/dist/re.js.map +0 -1
- package/dist/string.js.map +0 -1
package/dist/datetime.js
CHANGED
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
strptime,
|
|
8
8
|
time,
|
|
9
9
|
timedelta
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-LK2L2TFG.js";
|
|
11
|
+
import "./chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
|
13
13
|
MAXYEAR,
|
|
14
14
|
MINYEAR,
|
|
@@ -19,4 +19,3 @@ export {
|
|
|
19
19
|
time,
|
|
20
20
|
timedelta
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=datetime.js.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Python functools module for TypeScript
|
|
3
3
|
*
|
|
4
|
-
* Provides higher-order functions and operations on callable objects
|
|
4
|
+
* Provides higher-order functions and operations on callable objects,
|
|
5
|
+
* including partial application, function caching (lru_cache), and reduce.
|
|
5
6
|
*
|
|
6
7
|
* @see {@link https://docs.python.org/3/library/functools.html | Python functools documentation}
|
|
8
|
+
* @module
|
|
7
9
|
*/
|
|
8
10
|
/**
|
|
9
11
|
* Create a partial function application
|
package/dist/functools.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as attrGetter, c as cache, e as cmpToKey, d as identity, i as itemGetter, l as lruCache, m as methodCaller, p as partial, a as partialMethod, g as pipe, r as reduce, s as singleDispatch, t as totalOrdering, w as wraps } from './functools-
|
|
1
|
+
export { b as attrGetter, c as cache, e as cmpToKey, d as identity, i as itemGetter, l as lruCache, m as methodCaller, p as partial, a as partialMethod, g as pipe, r as reduce, s as singleDispatch, t as totalOrdering, w as wraps } from './functools-uIa5g75p.js';
|
package/dist/functools.js
CHANGED
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
singleDispatch,
|
|
14
14
|
totalOrdering,
|
|
15
15
|
wraps
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-D35YI363.js";
|
|
17
|
+
import "./chunk-MLKGABMK.js";
|
|
18
18
|
export {
|
|
19
19
|
attrGetter,
|
|
20
20
|
cache,
|
|
@@ -31,4 +31,3 @@ export {
|
|
|
31
31
|
totalOrdering,
|
|
32
32
|
wraps
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=functools.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python glob module for TypeScript - Browser version
|
|
3
|
+
*
|
|
4
|
+
* Browser stub - filesystem operations are not available.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link https://docs.python.org/3/library/glob.html | Python glob documentation}
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Return a list of paths matching a pathname pattern.
|
|
11
|
+
* Browser stub - always returns empty array.
|
|
12
|
+
*/
|
|
13
|
+
declare function glob(_pattern: string, _options?: {
|
|
14
|
+
recursive?: boolean;
|
|
15
|
+
rootDir?: string;
|
|
16
|
+
includeHidden?: boolean;
|
|
17
|
+
}): Promise<string[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Return an async iterator of paths matching a pathname pattern.
|
|
20
|
+
* Browser stub - yields nothing.
|
|
21
|
+
*/
|
|
22
|
+
declare function iglob(_pattern: string, _options?: {
|
|
23
|
+
recursive?: boolean;
|
|
24
|
+
rootDir?: string;
|
|
25
|
+
includeHidden?: boolean;
|
|
26
|
+
}): AsyncGenerator<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Escape all special characters in a pathname.
|
|
29
|
+
*/
|
|
30
|
+
declare function escape(pathname: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Return true if the pattern contains any magic glob characters.
|
|
33
|
+
*/
|
|
34
|
+
declare function hasMagic(pattern: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Return a list of all files matching pattern recursively.
|
|
37
|
+
* Browser stub - always returns empty array.
|
|
38
|
+
*/
|
|
39
|
+
declare function rglob(_pattern: string, _rootDir?: string): Promise<string[]>;
|
|
40
|
+
|
|
41
|
+
declare const globModule_escape: typeof escape;
|
|
42
|
+
declare const globModule_glob: typeof glob;
|
|
43
|
+
declare const globModule_hasMagic: typeof hasMagic;
|
|
44
|
+
declare const globModule_iglob: typeof iglob;
|
|
45
|
+
declare const globModule_rglob: typeof rglob;
|
|
46
|
+
declare namespace globModule {
|
|
47
|
+
export { globModule_escape as escape, globModule_glob as glob, globModule_hasMagic as hasMagic, globModule_iglob as iglob, globModule_rglob as rglob };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { glob as a, escape as e, globModule as g, hasMagic as h, iglob as i, rglob as r };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { e as escape, a as glob, h as hasMagic, i as iglob, r as rglob } from './glob.browser-B6d_YdV5.js';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python glob module for TypeScript
|
|
3
|
+
*
|
|
4
|
+
* Provides Unix shell-style pathname pattern matching with async operations.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link https://docs.python.org/3/library/glob.html | Python glob documentation}
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Return a list of paths matching a pathname pattern.
|
|
11
|
+
*
|
|
12
|
+
* The pattern may contain shell-style wildcards:
|
|
13
|
+
* - `*` matches any number of characters
|
|
14
|
+
* - `?` matches a single character
|
|
15
|
+
* - `[seq]` matches any character in seq
|
|
16
|
+
* - `[!seq]` matches any character not in seq
|
|
17
|
+
* - `**` matches everything, including any subdirectories
|
|
18
|
+
*
|
|
19
|
+
* @param pattern - The glob pattern
|
|
20
|
+
* @param options - Options object
|
|
21
|
+
* @returns Promise of array of matching paths
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* await glob("*.txt") // All .txt files in current directory
|
|
26
|
+
* await glob("**\/*.py") // All .py files recursively
|
|
27
|
+
* await glob("/path/to/*.js") // All .js files in /path/to
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare function glob(pattern: string, options?: {
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
rootDir?: string;
|
|
33
|
+
includeHidden?: boolean;
|
|
34
|
+
}): Promise<string[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Return an async iterator of paths matching a pathname pattern.
|
|
37
|
+
*
|
|
38
|
+
* @param pattern - The glob pattern
|
|
39
|
+
* @param options - Options object
|
|
40
|
+
* @returns AsyncGenerator of matching paths
|
|
41
|
+
*/
|
|
42
|
+
declare function iglob(pattern: string, options?: {
|
|
43
|
+
recursive?: boolean;
|
|
44
|
+
rootDir?: string;
|
|
45
|
+
includeHidden?: boolean;
|
|
46
|
+
}): AsyncGenerator<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Escape all special characters in a pathname.
|
|
49
|
+
*
|
|
50
|
+
* @param pathname - The path to escape
|
|
51
|
+
* @returns Escaped path safe for use in glob patterns
|
|
52
|
+
*/
|
|
53
|
+
declare function escape(pathname: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Return true if the pattern contains any magic glob characters.
|
|
56
|
+
*
|
|
57
|
+
* @param pattern - The pattern to check
|
|
58
|
+
* @returns True if pattern contains wildcards
|
|
59
|
+
*/
|
|
60
|
+
declare function hasMagic(pattern: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Return a list of all files matching pattern in directory and subdirectories.
|
|
63
|
+
* This is an alias for glob with recursive=true.
|
|
64
|
+
*
|
|
65
|
+
* @param pattern - The glob pattern (without **)
|
|
66
|
+
* @param rootDir - Root directory to search from
|
|
67
|
+
* @returns Promise of array of matching paths
|
|
68
|
+
*/
|
|
69
|
+
declare function rglob(pattern: string, rootDir?: string): Promise<string[]>;
|
|
70
|
+
|
|
71
|
+
declare const globModule_escape: typeof escape;
|
|
72
|
+
declare const globModule_glob: typeof glob;
|
|
73
|
+
declare const globModule_hasMagic: typeof hasMagic;
|
|
74
|
+
declare const globModule_iglob: typeof iglob;
|
|
75
|
+
declare const globModule_rglob: typeof rglob;
|
|
76
|
+
declare namespace globModule {
|
|
77
|
+
export { globModule_escape as escape, globModule_glob as glob, globModule_hasMagic as hasMagic, globModule_iglob as iglob, globModule_rglob as rglob };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { glob as a, escape as e, globModule as g, hasMagic as h, iglob as i, rglob as r };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { e as escape, a as glob, h as hasMagic, i as iglob, r as rglob } from './glob.node-wn5ehtyM.js';
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Python hashlib module for TypeScript
|
|
3
|
+
*
|
|
4
|
+
* Provides secure hash and message digest algorithms.
|
|
5
|
+
* Uses Node.js crypto module for server-side and Web Crypto API for browser.
|
|
6
|
+
*
|
|
7
|
+
* Note: Unlike Python's sync API, digest() and hexdigest() are async
|
|
8
|
+
* to support the Web Crypto API which only provides async operations.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://docs.python.org/3/library/hashlib.html | Python hashlib documentation}
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Hash object interface mimicking Python's hash object.
|
|
15
|
+
* Note: digest() and hexdigest() are async to support Web Crypto API.
|
|
16
|
+
*/
|
|
17
|
+
interface HashObject {
|
|
18
|
+
/** Name of the hash algorithm */
|
|
19
|
+
readonly name: string;
|
|
20
|
+
/** Digest size in bytes */
|
|
21
|
+
readonly digestSize: number;
|
|
22
|
+
/** Internal block size in bytes */
|
|
23
|
+
readonly blockSize: number;
|
|
24
|
+
/** Update the hash with data (sync - buffers data) */
|
|
25
|
+
update(data: Uint8Array | string): void;
|
|
26
|
+
/** Return the digest as bytes (async) */
|
|
27
|
+
digest(): Promise<Uint8Array>;
|
|
28
|
+
/** Return the digest as a hexadecimal string (async) */
|
|
29
|
+
hexdigest(): Promise<string>;
|
|
30
|
+
/** Return a copy of the hash object */
|
|
31
|
+
copy(): HashObject;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create a new hash object for the given algorithm.
|
|
35
|
+
*
|
|
36
|
+
* @param name - Name of the hash algorithm (e.g., "sha256", "md5")
|
|
37
|
+
* @param data - Optional initial data to hash
|
|
38
|
+
* @returns A hash object
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const h = newHash("sha256")
|
|
43
|
+
* h.update("hello")
|
|
44
|
+
* console.log(await h.hexdigest())
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function newHash(name: string, data?: Uint8Array | string): HashObject;
|
|
48
|
+
/**
|
|
49
|
+
* Create a new MD5 hash object.
|
|
50
|
+
* Note: MD5 is not available in Web Crypto API (browser).
|
|
51
|
+
*
|
|
52
|
+
* @param data - Optional initial data to hash
|
|
53
|
+
* @returns An MD5 hash object
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const h = md5("hello")
|
|
58
|
+
* console.log(await h.hexdigest()) // "5d41402abc4b2a76b9719d911017c592"
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare function md5(data?: Uint8Array | string): HashObject;
|
|
62
|
+
/**
|
|
63
|
+
* Create a new SHA-1 hash object.
|
|
64
|
+
*
|
|
65
|
+
* @param data - Optional initial data to hash
|
|
66
|
+
* @returns A SHA-1 hash object
|
|
67
|
+
*/
|
|
68
|
+
declare function sha1(data?: Uint8Array | string): HashObject;
|
|
69
|
+
/**
|
|
70
|
+
* Create a new SHA-224 hash object.
|
|
71
|
+
* Note: SHA-224 is not available in Web Crypto API (browser).
|
|
72
|
+
*
|
|
73
|
+
* @param data - Optional initial data to hash
|
|
74
|
+
* @returns A SHA-224 hash object
|
|
75
|
+
*/
|
|
76
|
+
declare function sha224(data?: Uint8Array | string): HashObject;
|
|
77
|
+
/**
|
|
78
|
+
* Create a new SHA-256 hash object.
|
|
79
|
+
*
|
|
80
|
+
* @param data - Optional initial data to hash
|
|
81
|
+
* @returns A SHA-256 hash object
|
|
82
|
+
*/
|
|
83
|
+
declare function sha256(data?: Uint8Array | string): HashObject;
|
|
84
|
+
/**
|
|
85
|
+
* Create a new SHA-384 hash object.
|
|
86
|
+
*
|
|
87
|
+
* @param data - Optional initial data to hash
|
|
88
|
+
* @returns A SHA-384 hash object
|
|
89
|
+
*/
|
|
90
|
+
declare function sha384(data?: Uint8Array | string): HashObject;
|
|
91
|
+
/**
|
|
92
|
+
* Create a new SHA-512 hash object.
|
|
93
|
+
*
|
|
94
|
+
* @param data - Optional initial data to hash
|
|
95
|
+
* @returns A SHA-512 hash object
|
|
96
|
+
*/
|
|
97
|
+
declare function sha512(data?: Uint8Array | string): HashObject;
|
|
98
|
+
/**
|
|
99
|
+
* Create a new SHA3-256 hash object.
|
|
100
|
+
* Note: SHA3 is not available in Web Crypto API (browser).
|
|
101
|
+
*
|
|
102
|
+
* @param data - Optional initial data to hash
|
|
103
|
+
* @returns A SHA3-256 hash object
|
|
104
|
+
*/
|
|
105
|
+
declare function sha3_256(data?: Uint8Array | string): HashObject;
|
|
106
|
+
/**
|
|
107
|
+
* Create a new SHA3-512 hash object.
|
|
108
|
+
* Note: SHA3 is not available in Web Crypto API (browser).
|
|
109
|
+
*
|
|
110
|
+
* @param data - Optional initial data to hash
|
|
111
|
+
* @returns A SHA3-512 hash object
|
|
112
|
+
*/
|
|
113
|
+
declare function sha3_512(data?: Uint8Array | string): HashObject;
|
|
114
|
+
/**
|
|
115
|
+
* Create a new BLAKE2b hash object.
|
|
116
|
+
* Note: BLAKE2 is not available in Web Crypto API (browser).
|
|
117
|
+
*
|
|
118
|
+
* @param data - Optional initial data to hash
|
|
119
|
+
* @returns A BLAKE2b hash object
|
|
120
|
+
*/
|
|
121
|
+
declare function blake2b(data?: Uint8Array | string): HashObject;
|
|
122
|
+
/**
|
|
123
|
+
* Create a new BLAKE2s hash object.
|
|
124
|
+
* Note: BLAKE2 is not available in Web Crypto API (browser).
|
|
125
|
+
*
|
|
126
|
+
* @param data - Optional initial data to hash
|
|
127
|
+
* @returns A BLAKE2s hash object
|
|
128
|
+
*/
|
|
129
|
+
declare function blake2s(data?: Uint8Array | string): HashObject;
|
|
130
|
+
/**
|
|
131
|
+
* Set of available hash algorithm names.
|
|
132
|
+
* Note: In browser, only SHA-1, SHA-256, SHA-384, SHA-512 are available.
|
|
133
|
+
*/
|
|
134
|
+
declare const algorithmsAvailable: Set<string>;
|
|
135
|
+
/**
|
|
136
|
+
* Set of hash algorithm names guaranteed to be available in all environments.
|
|
137
|
+
* These are the algorithms supported by Web Crypto API.
|
|
138
|
+
*/
|
|
139
|
+
declare const algorithmsGuaranteed: Set<string>;
|
|
140
|
+
/**
|
|
141
|
+
* Compute PBKDF2 key derivation.
|
|
142
|
+
* Note: This is async to support Web Crypto API.
|
|
143
|
+
*
|
|
144
|
+
* @param hashName - Name of the hash algorithm
|
|
145
|
+
* @param password - Password bytes
|
|
146
|
+
* @param salt - Salt bytes
|
|
147
|
+
* @param iterations - Number of iterations
|
|
148
|
+
* @param dklen - Derived key length in bytes
|
|
149
|
+
* @returns Derived key as Uint8Array
|
|
150
|
+
*/
|
|
151
|
+
declare function pbkdf2Hmac(hashName: string, password: Uint8Array | string, salt: Uint8Array | string, iterations: number, dklen: number): Promise<Uint8Array>;
|
|
152
|
+
/**
|
|
153
|
+
* Compute scrypt key derivation.
|
|
154
|
+
* Note: scrypt is only available in Node.js, not in Web Crypto API.
|
|
155
|
+
*
|
|
156
|
+
* @param password - Password bytes
|
|
157
|
+
* @param salt - Salt bytes
|
|
158
|
+
* @param n - CPU/memory cost parameter
|
|
159
|
+
* @param r - Block size parameter
|
|
160
|
+
* @param p - Parallelization parameter
|
|
161
|
+
* @param dklen - Derived key length in bytes
|
|
162
|
+
* @returns Derived key as Uint8Array
|
|
163
|
+
*/
|
|
164
|
+
declare function scrypt(password: Uint8Array | string, salt: Uint8Array | string, n: number, r: number, p: number, dklen: number): Promise<Uint8Array>;
|
|
165
|
+
/**
|
|
166
|
+
* Compare two byte sequences in constant time.
|
|
167
|
+
*
|
|
168
|
+
* @param a - First sequence
|
|
169
|
+
* @param b - Second sequence
|
|
170
|
+
* @returns True if sequences are equal
|
|
171
|
+
*/
|
|
172
|
+
declare function compareDigest(a: Uint8Array | string, b: Uint8Array | string): Promise<boolean>;
|
|
173
|
+
/**
|
|
174
|
+
* Generate a file hash.
|
|
175
|
+
* Note: Only available in Node.js.
|
|
176
|
+
*
|
|
177
|
+
* @param path - File path
|
|
178
|
+
* @param algorithm - Hash algorithm name
|
|
179
|
+
* @returns Hash as hex string
|
|
180
|
+
*/
|
|
181
|
+
declare function fileDigest(path: string, algorithm?: string): Promise<string>;
|
|
182
|
+
|
|
183
|
+
type hashlibModule_HashObject = HashObject;
|
|
184
|
+
declare const hashlibModule_algorithmsAvailable: typeof algorithmsAvailable;
|
|
185
|
+
declare const hashlibModule_algorithmsGuaranteed: typeof algorithmsGuaranteed;
|
|
186
|
+
declare const hashlibModule_blake2b: typeof blake2b;
|
|
187
|
+
declare const hashlibModule_blake2s: typeof blake2s;
|
|
188
|
+
declare const hashlibModule_compareDigest: typeof compareDigest;
|
|
189
|
+
declare const hashlibModule_fileDigest: typeof fileDigest;
|
|
190
|
+
declare const hashlibModule_md5: typeof md5;
|
|
191
|
+
declare const hashlibModule_newHash: typeof newHash;
|
|
192
|
+
declare const hashlibModule_pbkdf2Hmac: typeof pbkdf2Hmac;
|
|
193
|
+
declare const hashlibModule_scrypt: typeof scrypt;
|
|
194
|
+
declare const hashlibModule_sha1: typeof sha1;
|
|
195
|
+
declare const hashlibModule_sha224: typeof sha224;
|
|
196
|
+
declare const hashlibModule_sha256: typeof sha256;
|
|
197
|
+
declare const hashlibModule_sha384: typeof sha384;
|
|
198
|
+
declare const hashlibModule_sha3_256: typeof sha3_256;
|
|
199
|
+
declare const hashlibModule_sha3_512: typeof sha3_512;
|
|
200
|
+
declare const hashlibModule_sha512: typeof sha512;
|
|
201
|
+
declare namespace hashlibModule {
|
|
202
|
+
export { type hashlibModule_HashObject as HashObject, hashlibModule_algorithmsAvailable as algorithmsAvailable, hashlibModule_algorithmsGuaranteed as algorithmsGuaranteed, hashlibModule_blake2b as blake2b, hashlibModule_blake2s as blake2s, hashlibModule_compareDigest as compareDigest, hashlibModule_fileDigest as fileDigest, hashlibModule_md5 as md5, hashlibModule_newHash as newHash, hashlibModule_pbkdf2Hmac as pbkdf2Hmac, hashlibModule_scrypt as scrypt, hashlibModule_sha1 as sha1, hashlibModule_sha224 as sha224, hashlibModule_sha256 as sha256, hashlibModule_sha384 as sha384, hashlibModule_sha3_256 as sha3_256, hashlibModule_sha3_512 as sha3_512, hashlibModule_sha512 as sha512 };
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export { type HashObject as H, sha224 as a, sha256 as b, sha384 as c, sha512 as d, sha3_256 as e, sha3_512 as f, blake2b as g, hashlibModule as h, blake2s as i, algorithmsAvailable as j, algorithmsGuaranteed as k, scrypt as l, md5 as m, newHash as n, compareDigest as o, pbkdf2Hmac as p, fileDigest as q, sha1 as s };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { H as HashObject, j as algorithmsAvailable, k as algorithmsGuaranteed, g as blake2b, i as blake2s, o as compareDigest, q as fileDigest, m as md5, n as newHash, p as pbkdf2Hmac, l as scrypt, s as sha1, a as sha224, b as sha256, c as sha384, e as sha3_256, f as sha3_512, d as sha512 } from './hashlib-vKP511NY.js';
|
package/dist/hashlib.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
algorithmsAvailable,
|
|
3
|
+
algorithmsGuaranteed,
|
|
4
|
+
blake2b,
|
|
5
|
+
blake2s,
|
|
6
|
+
compareDigest,
|
|
7
|
+
fileDigest,
|
|
8
|
+
md5,
|
|
9
|
+
newHash,
|
|
10
|
+
pbkdf2Hmac,
|
|
11
|
+
scrypt,
|
|
12
|
+
sha1,
|
|
13
|
+
sha224,
|
|
14
|
+
sha256,
|
|
15
|
+
sha384,
|
|
16
|
+
sha3_256,
|
|
17
|
+
sha3_512,
|
|
18
|
+
sha512
|
|
19
|
+
} from "./chunk-JJKTRIVO.js";
|
|
20
|
+
import "./chunk-MLKGABMK.js";
|
|
21
|
+
export {
|
|
22
|
+
algorithmsAvailable,
|
|
23
|
+
algorithmsGuaranteed,
|
|
24
|
+
blake2b,
|
|
25
|
+
blake2s,
|
|
26
|
+
compareDigest,
|
|
27
|
+
fileDigest,
|
|
28
|
+
md5,
|
|
29
|
+
newHash,
|
|
30
|
+
pbkdf2Hmac,
|
|
31
|
+
scrypt,
|
|
32
|
+
sha1,
|
|
33
|
+
sha224,
|
|
34
|
+
sha256,
|
|
35
|
+
sha384,
|
|
36
|
+
sha3_256,
|
|
37
|
+
sha3_512,
|
|
38
|
+
sha512
|
|
39
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { i as itertoolsModule } from './itertools-T0rwOk2j.js';
|
|
2
|
+
import { f as functoolsModule } from './functools-uIa5g75p.js';
|
|
3
|
+
import { c as collectionsModule } from './collections-BthXtkEp.js';
|
|
4
|
+
import { m as mathModule } from './math-D2NPMc-x.js';
|
|
5
|
+
import { r as randomModule } from './random-DcS5jtEs.js';
|
|
6
|
+
import { j as jsonModule } from './json-DoWhX04T.js';
|
|
7
|
+
import { o as osModule } from './os.browser-krjSx5kF.js';
|
|
8
|
+
import { d as datetimeModule } from './datetime-BM_IjhTq.js';
|
|
9
|
+
import { r as reModule } from './re-Bo-IOqov.js';
|
|
10
|
+
import { capWords, Template } from './string.js';
|
|
11
|
+
import { s as sysModule } from './sys-IL8LgI_W.js';
|
|
12
|
+
import { t as timeModule } from './time-CcYhdiSu.js';
|
|
13
|
+
import { c as copyModule } from './copy-6ZaZ__ge.js';
|
|
14
|
+
import { b as base64Module } from './base64-C_am75Sv.js';
|
|
15
|
+
import { u as uuidModule } from './uuid-C0ypmn56.js';
|
|
16
|
+
import { h as hashlibModule } from './hashlib-vKP511NY.js';
|
|
17
|
+
import { p as pathlibModule } from './pathlib.browser-NC7kKQYe.js';
|
|
18
|
+
import { g as globModule } from './glob.browser-B6d_YdV5.js';
|
|
19
|
+
import { s as shutilModule } from './shutil.browser-Ck5oWhnP.js';
|
|
20
|
+
import { t as tempfileModule } from './tempfile.browser-DciOKfNm.js';
|
|
21
|
+
import { s as subprocessModule } from './subprocess-CZVYzQ3V.js';
|
|
22
|
+
import { u as urllibModule } from './urllib-DJtkj-0f.js';
|
|
23
|
+
import { l as loggingModule } from './logging.browser-Dux4L5kz.js';
|
|
24
|
+
import { l as list$1, d as dict$1, s as set$1, f as floorDiv$1, m as mod$1, a as divMod$1, b as sprintf$1, c as strFormat$1, e as slice$1, g as at$1, h as contains$1, i as is$1, r as range$1, j as enumerate$1, z as zip$1, k as iter$1, n as reversed$1, o as sorted$1, p as map$1, q as filter$1, t as tuple$1, u as len$1, v as abs$1, w as min$1, x as max$1, y as sum$1, A as all$1, B as any$1, C as round$1, D as ord$1, E as chr$1, F as hex$1, G as oct$1, H as bin$1, I as int$1, J as float$1, K as str$1, L as repr$1, M as bool$1, N as ascii$1, O as isinstance$1, P as type$1, Q as input$1, R as format$1, S as getattr$1, T as hasattr$1, U as setattr$1 } from './set-JQbLAq8B.js';
|
|
25
|
+
export { W as pow, V as repeatValue } from './set-JQbLAq8B.js';
|
|
26
|
+
import './os.shared-C3x70nhO.js';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Python Built-in Functions for TypeScript - Browser version
|
|
30
|
+
*
|
|
31
|
+
* This module provides Python's built-in functions that are always available
|
|
32
|
+
* without imports. These are the fundamental operations for working with data
|
|
33
|
+
* in Python, including iteration (range, enumerate, zip), aggregation (len,
|
|
34
|
+
* sum, min, max), type conversion (int, str, bool), and more.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* // Direct imports
|
|
39
|
+
* import { len, range, sorted, min, max } from "pythonlib"
|
|
40
|
+
*
|
|
41
|
+
* // Module imports (like Python)
|
|
42
|
+
* import { chain, combinations } from "pythonlib/itertools"
|
|
43
|
+
* import { Counter, defaultdict } from "pythonlib/collections"
|
|
44
|
+
*
|
|
45
|
+
* // Module namespaces
|
|
46
|
+
* import { json, re, itertools } from "pythonlib"
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://docs.python.org/3/library/functions.html | Python Built-in Functions}
|
|
50
|
+
* @module
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
declare const itertools: typeof itertoolsModule;
|
|
54
|
+
declare const functools: typeof functoolsModule;
|
|
55
|
+
declare const collections: typeof collectionsModule;
|
|
56
|
+
declare const math: typeof mathModule;
|
|
57
|
+
declare const random: typeof randomModule;
|
|
58
|
+
declare const json: typeof jsonModule;
|
|
59
|
+
declare const os: typeof osModule;
|
|
60
|
+
declare const datetime: typeof datetimeModule;
|
|
61
|
+
declare const re: typeof reModule;
|
|
62
|
+
declare const string: {
|
|
63
|
+
asciiLowercase: string;
|
|
64
|
+
asciiUppercase: string;
|
|
65
|
+
asciiLetters: string;
|
|
66
|
+
digits: string;
|
|
67
|
+
hexDigits: string;
|
|
68
|
+
octDigits: string;
|
|
69
|
+
punctuation: string;
|
|
70
|
+
whitespace: string;
|
|
71
|
+
printable: string;
|
|
72
|
+
capWords: typeof capWords;
|
|
73
|
+
Template: typeof Template;
|
|
74
|
+
join(sep: string, iterable: Iterable<string>): string;
|
|
75
|
+
split(s: string, sep?: string, maxsplit?: number): string[];
|
|
76
|
+
rSplit(s: string, sep?: string, maxsplit?: number): string[];
|
|
77
|
+
strip(s: string, chars?: string): string;
|
|
78
|
+
lStrip(s: string, chars?: string): string;
|
|
79
|
+
rStrip(s: string, chars?: string): string;
|
|
80
|
+
upper(s: string): string;
|
|
81
|
+
lower(s: string): string;
|
|
82
|
+
capitalize(s: string): string;
|
|
83
|
+
title(s: string): string;
|
|
84
|
+
swapCase(s: string): string;
|
|
85
|
+
startsWith(s: string, prefix: string, start?: number, end?: number): boolean;
|
|
86
|
+
endsWith(s: string, suffix: string, start?: number, end?: number): boolean;
|
|
87
|
+
find(s: string, sub: string, start?: number, end?: number): number;
|
|
88
|
+
rFind(s: string, sub: string, start?: number, end?: number): number;
|
|
89
|
+
index(s: string, sub: string, start?: number, end?: number): number;
|
|
90
|
+
rIndex(s: string, sub: string, start?: number, end?: number): number;
|
|
91
|
+
count(s: string, sub: string, start?: number, end?: number): number;
|
|
92
|
+
replace(s: string, old: string, newStr: string, count?: number): string;
|
|
93
|
+
zFill(s: string, width: number): string;
|
|
94
|
+
center(s: string, width: number, fillchar?: string): string;
|
|
95
|
+
lJust(s: string, width: number, fillchar?: string): string;
|
|
96
|
+
rJust(s: string, width: number, fillchar?: string): string;
|
|
97
|
+
partition(s: string, sep: string): [string, string, string];
|
|
98
|
+
rPartition(s: string, sep: string): [string, string, string];
|
|
99
|
+
isAlpha(s: string): boolean;
|
|
100
|
+
isDigit(s: string): boolean;
|
|
101
|
+
isAlnum(s: string): boolean;
|
|
102
|
+
isSpace(s: string): boolean;
|
|
103
|
+
isUpper(s: string): boolean;
|
|
104
|
+
isLower(s: string): boolean;
|
|
105
|
+
format(s: string, ...args: unknown[]): string;
|
|
106
|
+
};
|
|
107
|
+
declare const sys: typeof sysModule;
|
|
108
|
+
declare const time: typeof timeModule;
|
|
109
|
+
declare const copy: typeof copyModule;
|
|
110
|
+
declare const base64: typeof base64Module;
|
|
111
|
+
declare const uuid: typeof uuidModule;
|
|
112
|
+
declare const hashlib: typeof hashlibModule;
|
|
113
|
+
declare const pathlib: typeof pathlibModule;
|
|
114
|
+
declare const glob: typeof globModule;
|
|
115
|
+
declare const shutil: typeof shutilModule;
|
|
116
|
+
declare const tempfile: typeof tempfileModule;
|
|
117
|
+
declare const subprocess: typeof subprocessModule;
|
|
118
|
+
declare const urllib: typeof urllibModule;
|
|
119
|
+
declare const logging: typeof loggingModule;
|
|
120
|
+
type ListConstructor = (<T>(iterable?: Iterable<T>) => T[]) & typeof list$1;
|
|
121
|
+
type DictConstructor = (<K, V>(entries?: Iterable<[K, V]>) => Map<K, V>) & typeof dict$1;
|
|
122
|
+
type SetConstructor = (<T>(iterable?: Iterable<T>) => Set<T>) & typeof set$1;
|
|
123
|
+
declare const list: ListConstructor;
|
|
124
|
+
declare const dict: DictConstructor;
|
|
125
|
+
declare const set: SetConstructor;
|
|
126
|
+
declare const floorDiv: typeof floorDiv$1;
|
|
127
|
+
declare const mod: typeof mod$1;
|
|
128
|
+
declare const divMod: typeof divMod$1;
|
|
129
|
+
declare const sprintf: typeof sprintf$1;
|
|
130
|
+
declare const strFormat: typeof strFormat$1;
|
|
131
|
+
declare const slice: typeof slice$1;
|
|
132
|
+
declare const at: typeof at$1;
|
|
133
|
+
declare const contains: typeof contains$1;
|
|
134
|
+
declare const is: typeof is$1;
|
|
135
|
+
|
|
136
|
+
declare const range: typeof range$1;
|
|
137
|
+
declare const enumerate: typeof enumerate$1;
|
|
138
|
+
declare const zip: typeof zip$1;
|
|
139
|
+
declare const iter: typeof iter$1;
|
|
140
|
+
declare const reversed: typeof reversed$1;
|
|
141
|
+
declare const sorted: typeof sorted$1;
|
|
142
|
+
declare const map: typeof map$1;
|
|
143
|
+
declare const filter: typeof filter$1;
|
|
144
|
+
declare const tuple: typeof tuple$1;
|
|
145
|
+
declare const len: typeof len$1;
|
|
146
|
+
declare const abs: typeof abs$1;
|
|
147
|
+
declare const min: typeof min$1;
|
|
148
|
+
declare const max: typeof max$1;
|
|
149
|
+
declare const sum: typeof sum$1;
|
|
150
|
+
declare const all: typeof all$1;
|
|
151
|
+
declare const any: typeof any$1;
|
|
152
|
+
declare const round: typeof round$1;
|
|
153
|
+
declare const ord: typeof ord$1;
|
|
154
|
+
declare const chr: typeof chr$1;
|
|
155
|
+
declare const hex: typeof hex$1;
|
|
156
|
+
declare const oct: typeof oct$1;
|
|
157
|
+
declare const bin: typeof bin$1;
|
|
158
|
+
declare const int: typeof int$1;
|
|
159
|
+
declare const float: typeof float$1;
|
|
160
|
+
declare const str: typeof str$1;
|
|
161
|
+
declare const repr: typeof repr$1;
|
|
162
|
+
declare const bool: typeof bool$1;
|
|
163
|
+
declare const ascii: typeof ascii$1;
|
|
164
|
+
declare const isinstance: typeof isinstance$1;
|
|
165
|
+
declare const type: typeof type$1;
|
|
166
|
+
declare const input: typeof input$1;
|
|
167
|
+
declare const format: typeof format$1;
|
|
168
|
+
declare const getattr: typeof getattr$1;
|
|
169
|
+
declare const hasattr: typeof hasattr$1;
|
|
170
|
+
declare const setattr: typeof setattr$1;
|
|
171
|
+
|
|
172
|
+
export { abs, all, any, ascii, at, base64, bin, bool, chr, collections, contains, copy, datetime, dict, divMod, enumerate, filter, float, floorDiv, format, functools, getattr, glob, hasattr, hashlib, hex, input, int, is, isinstance, iter, itertools, json, len, list, logging, map, math, max, min, mod, oct, ord, os, pathlib, random, range, re, repr, reversed, round, set, setattr, shutil, slice, sorted, sprintf, str, strFormat, string, subprocess, sum, sys, tempfile, time, tuple, type, urllib, uuid, zip };
|