@ddunigma/node 5.0.0 → 6.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/CHANGELOG.md +234 -0
- package/README.md +23 -167
- package/ROADMAP.md +92 -0
- package/dist/BrowserAdapter-A6RBN4N3.js +1 -0
- package/dist/BrowserAdapter-NWASGV3D.cjs +1 -0
- package/dist/NodeAdapter-4R7CNTHP.cjs +1 -0
- package/dist/NodeAdapter-YP22CLUP.js +1 -0
- package/dist/ObfuscationLayer-4rCOCRWH.d.cts +89 -0
- package/dist/ObfuscationLayer-DTlA723P.d.ts +89 -0
- package/dist/{ObfuscationLayer-BDr-0s1M.d.ts → WebStreams-C16QV2Dz.d.ts} +43 -101
- package/dist/{ObfuscationLayer-BgL73E5F.d.cts → WebStreams-CY9E19f5.d.cts} +43 -101
- package/dist/browser.cjs +1 -2
- package/dist/browser.d.cts +28 -24
- package/dist/browser.d.ts +28 -24
- package/dist/browser.js +1 -2
- package/dist/chunk-6N7QYPEJ.js +1 -0
- package/dist/chunk-6ZYMNHFT.js +1 -0
- package/dist/chunk-76X5J2OF.cjs +1 -0
- package/dist/chunk-7EPVCA2F.js +1 -0
- package/dist/chunk-7KUEHTG2.js +1 -0
- package/dist/chunk-BCUBYE76.cjs +1 -0
- package/dist/chunk-BDP7E7K3.cjs +1 -0
- package/dist/chunk-EI7MMDWY.js +1 -0
- package/dist/chunk-HUUB5BUS.cjs +1 -0
- package/dist/chunk-IZK7KCU7.js +1 -0
- package/dist/chunk-JBUTKSCC.cjs +9 -0
- package/dist/chunk-JY2ZPBJK.cjs +1 -0
- package/dist/chunk-LCOYWJWO.cjs +1 -0
- package/dist/chunk-Q6SCBUV2.js +1 -0
- package/dist/chunk-VW2SZR2Z.js +9 -0
- package/dist/chunk-ZTGECGM2.cjs +1 -0
- package/dist/{errors-DNICpo4L.d.cts → core-BsIwjJK-.d.cts} +137 -74
- package/dist/{errors-DNICpo4L.d.ts → core-BsIwjJK-.d.ts} +137 -74
- package/dist/core.cjs +1 -2
- package/dist/core.d.cts +1 -40
- package/dist/core.d.ts +1 -40
- package/dist/core.js +1 -2
- package/dist/index.cjs +1 -2
- package/dist/index.d.cts +36 -83
- package/dist/index.d.ts +36 -83
- package/dist/index.js +1 -2
- package/dist/secure.browser.cjs +1 -0
- package/dist/secure.browser.d.cts +19 -0
- package/dist/secure.browser.d.ts +19 -0
- package/dist/secure.browser.js +1 -0
- package/dist/secure.cjs +1 -0
- package/dist/secure.d.cts +111 -0
- package/dist/secure.d.ts +111 -0
- package/dist/secure.js +1 -0
- package/docs/REFERENCE.md +235 -0
- package/package.json +58 -17
- package/dist/BrowserAdapter-HORDDCOE.js +0 -2
- package/dist/BrowserAdapter-PB4J6FHX.cjs +0 -2
- package/dist/NodeAdapter-5FBNCJSG.js +0 -2
- package/dist/NodeAdapter-EQ73FGEJ.cjs +0 -2
- package/dist/chunk-5NSHXTMN.cjs +0 -2
- package/dist/chunk-7RWUNW5S.js +0 -2
- package/dist/chunk-AMOZHHMB.cjs +0 -2
- package/dist/chunk-CQATQOBZ.js +0 -2
- package/dist/chunk-HTZT725P.js +0 -10
- package/dist/chunk-HZJ7PU7X.cjs +0 -2
- package/dist/chunk-KS6PRP5Y.js +0 -2
- package/dist/chunk-OQXMQIE3.js +0 -2
- package/dist/chunk-UMA4JEN4.cjs +0 -10
- package/dist/chunk-WCXD5LRF.cjs +0 -2
- package/dist/wasm/codec.wasm +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,35 +1,56 @@
|
|
|
1
|
-
import { D as Ddu64Core, a as
|
|
2
|
-
export { C as CharSetConfig,
|
|
3
|
-
export {
|
|
1
|
+
import { D as Ddu64Core, a as DduBaseConstructorOptions, b as DduBaseOptions, c as DduEncodeStats } from './core-BsIwjJK-.cjs';
|
|
2
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, f as Ddu64AdapterError, g as Ddu64CharsetError, h as Ddu64ChecksumError, i as Ddu64CompressionError, j as Ddu64DecodeError, k as Ddu64DecompressionError, l as Ddu64DecryptionError, m as Ddu64EncodeError, n as Ddu64EncryptionError, o as Ddu64Error, p as Ddu64ErrorCode, q as Ddu64ErrorOptions, r as Ddu64InvalidInputError, s as Ddu64LimitError, t as Ddu64ObfuscationError, u as Ddu64Operation, v as Ddu64StreamError, w as DduProgressInfo, x as DduSetSymbol, y as DduSetSymbolInput, E as EncodingProfile, O as ObfuscationLayer, z as isDdu64Error } from './core-BsIwjJK-.cjs';
|
|
3
|
+
export { H as HangulObfuscationLayer, c as createEncoderObfuscationLayer, d as detectRuntime } from './ObfuscationLayer-4rCOCRWH.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Node.js 전용 Ddu64 래퍼.
|
|
6
|
+
* Node.js 전용 기본(lean) Ddu64 래퍼.
|
|
7
7
|
*
|
|
8
|
-
* Ddu64Core를 확장하여
|
|
9
|
-
*
|
|
8
|
+
* Ddu64Core를 확장하여 인코딩 + 한글 난독화(라이브러리 주목적: 재미 + 시각적 난독화)와
|
|
9
|
+
* Node.js Buffer 디코드를 제공합니다:
|
|
10
|
+
* - HangulObfuscationLayer 자동 주입 → 키 없는 한글 난독화 사용 가능
|
|
10
11
|
* - Node.js Buffer를 반환하는 `decodeToBuffer` 및 `decodeToBufferAsync` 제공
|
|
11
12
|
* - encode()에 Buffer 입력 허용 (Buffer는 Uint8Array를 확장)
|
|
12
13
|
*
|
|
14
|
+
* 6.0: 어댑터(zlib/crypto)를 주입하지 않습니다. 압축/암호화/체크섬/스트림이 필요하면
|
|
15
|
+
* secure 진입점(`@ddunigma/node/secure`)의 `Ddu64Secure`를 사용하세요. 어댑터 미주입으로
|
|
16
|
+
* crypto/zlib/CRC32가 기본 번들에서 트리셰이킹됩니다.
|
|
17
|
+
*
|
|
13
18
|
* @module Ddu64Node
|
|
14
19
|
*/
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
|
-
* Node.js 전용 Ddu64
|
|
22
|
+
* Node.js 전용 기본 Ddu64 인코더/디코더 (lean).
|
|
18
23
|
*
|
|
19
|
-
* Ddu64Core를 래핑하여 자동
|
|
24
|
+
* Ddu64Core를 래핑하여 한글 난독화 레이어를 자동 주입하고,
|
|
20
25
|
* 하위 호환성을 위한 Buffer 반환 디코드 메서드를 제공합니다.
|
|
21
26
|
*
|
|
22
27
|
* @example
|
|
23
28
|
* ```ts
|
|
24
|
-
* import {
|
|
29
|
+
* import { Ddu64 } from '@ddunigma/node';
|
|
25
30
|
*
|
|
26
|
-
* const encoder = new
|
|
27
|
-
* const encoded = encoder.encode(Buffer.from('Hello'));
|
|
31
|
+
* const encoder = new Ddu64();
|
|
32
|
+
* const encoded = encoder.encode(Buffer.from('Hello'), { obfuscate: true });
|
|
28
33
|
* const decoded = encoder.decodeToBuffer(encoded); // Buffer 반환
|
|
29
34
|
* ```
|
|
30
35
|
*/
|
|
31
36
|
declare class Ddu64Node extends Ddu64Core {
|
|
32
|
-
constructor(dduChar?: string[] | string |
|
|
37
|
+
constructor(dduChar?: string[] | string | DduBaseConstructorOptions, paddingChar?: string, dduOptions?: DduBaseConstructorOptions);
|
|
38
|
+
/** @group Sync */
|
|
39
|
+
encode(input: Uint8Array | string, options?: DduBaseOptions): string;
|
|
40
|
+
/** @group Async */
|
|
41
|
+
encodeAsync(input: Uint8Array | string, options?: DduBaseOptions): Promise<string>;
|
|
42
|
+
/** @group Sync */
|
|
43
|
+
decode(input: string, options?: DduBaseOptions): string;
|
|
44
|
+
/** @group Async */
|
|
45
|
+
decodeAsync(input: string, options?: DduBaseOptions): Promise<string>;
|
|
46
|
+
/** @group Sync */
|
|
47
|
+
decodeToUint8Array(input: string, options?: DduBaseOptions): Uint8Array;
|
|
48
|
+
/** @group Async */
|
|
49
|
+
decodeToUint8ArrayAsync(input: string, options?: DduBaseOptions): Promise<Uint8Array>;
|
|
50
|
+
/** @group Introspection */
|
|
51
|
+
getStats(input: Uint8Array | string, options?: DduBaseOptions): DduEncodeStats;
|
|
52
|
+
/** @group Introspection */
|
|
53
|
+
getStatsAsync(input: Uint8Array | string, options?: DduBaseOptions): Promise<DduEncodeStats>;
|
|
33
54
|
/**
|
|
34
55
|
* 인코딩된 문자열을 Node.js Buffer로 디코딩합니다.
|
|
35
56
|
*
|
|
@@ -38,7 +59,7 @@ declare class Ddu64Node extends Ddu64Core {
|
|
|
38
59
|
* @returns 디코딩된 Buffer
|
|
39
60
|
* @group Sync
|
|
40
61
|
*/
|
|
41
|
-
decodeToBuffer(input: string, options?:
|
|
62
|
+
decodeToBuffer(input: string, options?: DduBaseOptions): Buffer;
|
|
42
63
|
/**
|
|
43
64
|
* 비동기적으로 Node.js Buffer로 디코딩합니다.
|
|
44
65
|
*
|
|
@@ -47,75 +68,7 @@ declare class Ddu64Node extends Ddu64Core {
|
|
|
47
68
|
* @returns 디코딩된 Buffer로 resolve되는 Promise
|
|
48
69
|
* @group Async
|
|
49
70
|
*/
|
|
50
|
-
decodeToBufferAsync(input: string, options?:
|
|
71
|
+
decodeToBufferAsync(input: string, options?: DduBaseOptions): Promise<Buffer>;
|
|
51
72
|
}
|
|
52
73
|
|
|
53
|
-
|
|
54
|
-
* Node.js 플랫폼 어댑터 구현.
|
|
55
|
-
* Node.js `crypto`와 `zlib` 모듈을 래핑하여 PlatformAdapter 인터페이스를 구현합니다.
|
|
56
|
-
*
|
|
57
|
-
* @module adapters/NodeAdapter
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* PlatformAdapter의 Node.js 구현.
|
|
62
|
-
* 네이티브 Node.js `crypto`와 `zlib` 모듈을 사용하여
|
|
63
|
-
* 동기 및 비동기 암호화/압축 연산을 제공합니다.
|
|
64
|
-
*/
|
|
65
|
-
declare class NodeAdapter implements PlatformAdapter {
|
|
66
|
-
readonly supportsSyncCrypto = true;
|
|
67
|
-
readonly supportsSyncCompression = true;
|
|
68
|
-
readonly supportsBrotli = true;
|
|
69
|
-
readonly runtime: "node";
|
|
70
|
-
deriveKey(key: string, options?: KeyDerivationOptions): Promise<Uint8Array>;
|
|
71
|
-
deriveKeySync(key: string, options?: KeyDerivationOptions): Uint8Array;
|
|
72
|
-
encrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
73
|
-
encryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
74
|
-
decrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
75
|
-
decryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
76
|
-
randomBytes(length: number): Uint8Array;
|
|
77
|
-
deflate(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
78
|
-
deflateSync(data: Uint8Array, level?: number): Uint8Array;
|
|
79
|
-
inflate(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
80
|
-
inflateSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
81
|
-
brotliCompress(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
82
|
-
brotliCompressSync(data: Uint8Array, level?: number): Uint8Array;
|
|
83
|
-
brotliDecompress(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
84
|
-
brotliDecompressSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 런타임 자동 감지 모듈.
|
|
89
|
-
* 현재 JavaScript 런타임 환경을 감지하고 적절한 PlatformAdapter를 반환합니다.
|
|
90
|
-
*
|
|
91
|
-
* 중요: 이 모듈은 Node.js 내장 모듈을 임포트하지 않습니다.
|
|
92
|
-
* 감지는 순수하게 globalThis 검사에 기반합니다.
|
|
93
|
-
*
|
|
94
|
-
* @module adapters/detect
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 현재 런타임에 적합한 PlatformAdapter를 가져옵니다.
|
|
99
|
-
*
|
|
100
|
-
* 실제로 필요할 때까지 플랫폼별 모듈을 임포트하지 않는
|
|
101
|
-
* 지연 로딩을 사용합니다.
|
|
102
|
-
*
|
|
103
|
-
* @returns 적절한 PlatformAdapter로 resolve되는 Promise
|
|
104
|
-
* @throws 적합한 런타임이 감지되지 않은 경우 에러
|
|
105
|
-
*/
|
|
106
|
-
declare function getAdapter(): Promise<PlatformAdapter>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Node.js 파일시스템 기반 WASM 로더.
|
|
110
|
-
*
|
|
111
|
-
* 브라우저/core 엔트리에서 Node.js 내장 모듈이 번들에 섞이지 않도록
|
|
112
|
-
* Node 전용 진입점(`@ddunigma/node`)에서만 이 모듈을 가져옵니다.
|
|
113
|
-
*
|
|
114
|
-
* @module wasm/WasmCodecNode
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
declare function preloadWasm(): Promise<void>;
|
|
118
|
-
declare function getWasmCodec(): WasmCodec | null;
|
|
119
|
-
declare function getWasmCodecSync(): WasmCodec | null;
|
|
120
|
-
|
|
121
|
-
export { Ddu64Node as Ddu64, Ddu64Core, Ddu64Node, DduConstructorOptions, DduOptions, KeyDerivationOptions, NodeAdapter, PlatformAdapter, WasmCodec, getAdapter, getWasmCodec, getWasmCodecSync, preloadWasm };
|
|
74
|
+
export { Ddu64Node as Ddu64, Ddu64Core, Ddu64Node, DduBaseConstructorOptions, DduBaseOptions, DduEncodeStats };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,56 @@
|
|
|
1
|
-
import { D as Ddu64Core, a as
|
|
2
|
-
export { C as CharSetConfig,
|
|
3
|
-
export {
|
|
1
|
+
import { D as Ddu64Core, a as DduBaseConstructorOptions, b as DduBaseOptions, c as DduEncodeStats } from './core-BsIwjJK-.js';
|
|
2
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, f as Ddu64AdapterError, g as Ddu64CharsetError, h as Ddu64ChecksumError, i as Ddu64CompressionError, j as Ddu64DecodeError, k as Ddu64DecompressionError, l as Ddu64DecryptionError, m as Ddu64EncodeError, n as Ddu64EncryptionError, o as Ddu64Error, p as Ddu64ErrorCode, q as Ddu64ErrorOptions, r as Ddu64InvalidInputError, s as Ddu64LimitError, t as Ddu64ObfuscationError, u as Ddu64Operation, v as Ddu64StreamError, w as DduProgressInfo, x as DduSetSymbol, y as DduSetSymbolInput, E as EncodingProfile, O as ObfuscationLayer, z as isDdu64Error } from './core-BsIwjJK-.js';
|
|
3
|
+
export { H as HangulObfuscationLayer, c as createEncoderObfuscationLayer, d as detectRuntime } from './ObfuscationLayer-DTlA723P.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Node.js 전용 Ddu64 래퍼.
|
|
6
|
+
* Node.js 전용 기본(lean) Ddu64 래퍼.
|
|
7
7
|
*
|
|
8
|
-
* Ddu64Core를 확장하여
|
|
9
|
-
*
|
|
8
|
+
* Ddu64Core를 확장하여 인코딩 + 한글 난독화(라이브러리 주목적: 재미 + 시각적 난독화)와
|
|
9
|
+
* Node.js Buffer 디코드를 제공합니다:
|
|
10
|
+
* - HangulObfuscationLayer 자동 주입 → 키 없는 한글 난독화 사용 가능
|
|
10
11
|
* - Node.js Buffer를 반환하는 `decodeToBuffer` 및 `decodeToBufferAsync` 제공
|
|
11
12
|
* - encode()에 Buffer 입력 허용 (Buffer는 Uint8Array를 확장)
|
|
12
13
|
*
|
|
14
|
+
* 6.0: 어댑터(zlib/crypto)를 주입하지 않습니다. 압축/암호화/체크섬/스트림이 필요하면
|
|
15
|
+
* secure 진입점(`@ddunigma/node/secure`)의 `Ddu64Secure`를 사용하세요. 어댑터 미주입으로
|
|
16
|
+
* crypto/zlib/CRC32가 기본 번들에서 트리셰이킹됩니다.
|
|
17
|
+
*
|
|
13
18
|
* @module Ddu64Node
|
|
14
19
|
*/
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
|
-
* Node.js 전용 Ddu64
|
|
22
|
+
* Node.js 전용 기본 Ddu64 인코더/디코더 (lean).
|
|
18
23
|
*
|
|
19
|
-
* Ddu64Core를 래핑하여 자동
|
|
24
|
+
* Ddu64Core를 래핑하여 한글 난독화 레이어를 자동 주입하고,
|
|
20
25
|
* 하위 호환성을 위한 Buffer 반환 디코드 메서드를 제공합니다.
|
|
21
26
|
*
|
|
22
27
|
* @example
|
|
23
28
|
* ```ts
|
|
24
|
-
* import {
|
|
29
|
+
* import { Ddu64 } from '@ddunigma/node';
|
|
25
30
|
*
|
|
26
|
-
* const encoder = new
|
|
27
|
-
* const encoded = encoder.encode(Buffer.from('Hello'));
|
|
31
|
+
* const encoder = new Ddu64();
|
|
32
|
+
* const encoded = encoder.encode(Buffer.from('Hello'), { obfuscate: true });
|
|
28
33
|
* const decoded = encoder.decodeToBuffer(encoded); // Buffer 반환
|
|
29
34
|
* ```
|
|
30
35
|
*/
|
|
31
36
|
declare class Ddu64Node extends Ddu64Core {
|
|
32
|
-
constructor(dduChar?: string[] | string |
|
|
37
|
+
constructor(dduChar?: string[] | string | DduBaseConstructorOptions, paddingChar?: string, dduOptions?: DduBaseConstructorOptions);
|
|
38
|
+
/** @group Sync */
|
|
39
|
+
encode(input: Uint8Array | string, options?: DduBaseOptions): string;
|
|
40
|
+
/** @group Async */
|
|
41
|
+
encodeAsync(input: Uint8Array | string, options?: DduBaseOptions): Promise<string>;
|
|
42
|
+
/** @group Sync */
|
|
43
|
+
decode(input: string, options?: DduBaseOptions): string;
|
|
44
|
+
/** @group Async */
|
|
45
|
+
decodeAsync(input: string, options?: DduBaseOptions): Promise<string>;
|
|
46
|
+
/** @group Sync */
|
|
47
|
+
decodeToUint8Array(input: string, options?: DduBaseOptions): Uint8Array;
|
|
48
|
+
/** @group Async */
|
|
49
|
+
decodeToUint8ArrayAsync(input: string, options?: DduBaseOptions): Promise<Uint8Array>;
|
|
50
|
+
/** @group Introspection */
|
|
51
|
+
getStats(input: Uint8Array | string, options?: DduBaseOptions): DduEncodeStats;
|
|
52
|
+
/** @group Introspection */
|
|
53
|
+
getStatsAsync(input: Uint8Array | string, options?: DduBaseOptions): Promise<DduEncodeStats>;
|
|
33
54
|
/**
|
|
34
55
|
* 인코딩된 문자열을 Node.js Buffer로 디코딩합니다.
|
|
35
56
|
*
|
|
@@ -38,7 +59,7 @@ declare class Ddu64Node extends Ddu64Core {
|
|
|
38
59
|
* @returns 디코딩된 Buffer
|
|
39
60
|
* @group Sync
|
|
40
61
|
*/
|
|
41
|
-
decodeToBuffer(input: string, options?:
|
|
62
|
+
decodeToBuffer(input: string, options?: DduBaseOptions): Buffer;
|
|
42
63
|
/**
|
|
43
64
|
* 비동기적으로 Node.js Buffer로 디코딩합니다.
|
|
44
65
|
*
|
|
@@ -47,75 +68,7 @@ declare class Ddu64Node extends Ddu64Core {
|
|
|
47
68
|
* @returns 디코딩된 Buffer로 resolve되는 Promise
|
|
48
69
|
* @group Async
|
|
49
70
|
*/
|
|
50
|
-
decodeToBufferAsync(input: string, options?:
|
|
71
|
+
decodeToBufferAsync(input: string, options?: DduBaseOptions): Promise<Buffer>;
|
|
51
72
|
}
|
|
52
73
|
|
|
53
|
-
|
|
54
|
-
* Node.js 플랫폼 어댑터 구현.
|
|
55
|
-
* Node.js `crypto`와 `zlib` 모듈을 래핑하여 PlatformAdapter 인터페이스를 구현합니다.
|
|
56
|
-
*
|
|
57
|
-
* @module adapters/NodeAdapter
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* PlatformAdapter의 Node.js 구현.
|
|
62
|
-
* 네이티브 Node.js `crypto`와 `zlib` 모듈을 사용하여
|
|
63
|
-
* 동기 및 비동기 암호화/압축 연산을 제공합니다.
|
|
64
|
-
*/
|
|
65
|
-
declare class NodeAdapter implements PlatformAdapter {
|
|
66
|
-
readonly supportsSyncCrypto = true;
|
|
67
|
-
readonly supportsSyncCompression = true;
|
|
68
|
-
readonly supportsBrotli = true;
|
|
69
|
-
readonly runtime: "node";
|
|
70
|
-
deriveKey(key: string, options?: KeyDerivationOptions): Promise<Uint8Array>;
|
|
71
|
-
deriveKeySync(key: string, options?: KeyDerivationOptions): Uint8Array;
|
|
72
|
-
encrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
73
|
-
encryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
74
|
-
decrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
75
|
-
decryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
76
|
-
randomBytes(length: number): Uint8Array;
|
|
77
|
-
deflate(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
78
|
-
deflateSync(data: Uint8Array, level?: number): Uint8Array;
|
|
79
|
-
inflate(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
80
|
-
inflateSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
81
|
-
brotliCompress(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
82
|
-
brotliCompressSync(data: Uint8Array, level?: number): Uint8Array;
|
|
83
|
-
brotliDecompress(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
84
|
-
brotliDecompressSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 런타임 자동 감지 모듈.
|
|
89
|
-
* 현재 JavaScript 런타임 환경을 감지하고 적절한 PlatformAdapter를 반환합니다.
|
|
90
|
-
*
|
|
91
|
-
* 중요: 이 모듈은 Node.js 내장 모듈을 임포트하지 않습니다.
|
|
92
|
-
* 감지는 순수하게 globalThis 검사에 기반합니다.
|
|
93
|
-
*
|
|
94
|
-
* @module adapters/detect
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 현재 런타임에 적합한 PlatformAdapter를 가져옵니다.
|
|
99
|
-
*
|
|
100
|
-
* 실제로 필요할 때까지 플랫폼별 모듈을 임포트하지 않는
|
|
101
|
-
* 지연 로딩을 사용합니다.
|
|
102
|
-
*
|
|
103
|
-
* @returns 적절한 PlatformAdapter로 resolve되는 Promise
|
|
104
|
-
* @throws 적합한 런타임이 감지되지 않은 경우 에러
|
|
105
|
-
*/
|
|
106
|
-
declare function getAdapter(): Promise<PlatformAdapter>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Node.js 파일시스템 기반 WASM 로더.
|
|
110
|
-
*
|
|
111
|
-
* 브라우저/core 엔트리에서 Node.js 내장 모듈이 번들에 섞이지 않도록
|
|
112
|
-
* Node 전용 진입점(`@ddunigma/node`)에서만 이 모듈을 가져옵니다.
|
|
113
|
-
*
|
|
114
|
-
* @module wasm/WasmCodecNode
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
declare function preloadWasm(): Promise<void>;
|
|
118
|
-
declare function getWasmCodec(): WasmCodec | null;
|
|
119
|
-
declare function getWasmCodecSync(): WasmCodec | null;
|
|
120
|
-
|
|
121
|
-
export { Ddu64Node as Ddu64, Ddu64Core, Ddu64Node, DduConstructorOptions, DduOptions, KeyDerivationOptions, NodeAdapter, PlatformAdapter, WasmCodec, getAdapter, getWasmCodec, getWasmCodecSync, preloadWasm };
|
|
74
|
+
export { Ddu64Node as Ddu64, Ddu64Core, Ddu64Node, DduBaseConstructorOptions, DduBaseOptions, DduEncodeStats };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import {a as a$1}from'./chunk-6N7QYPEJ.js';export{a as HangulObfuscationLayer,b as createEncoderObfuscationLayer,c as detectRuntime}from'./chunk-6N7QYPEJ.js';import {i,b}from'./chunk-VW2SZR2Z.js';export{j as CharsetBuilder,i as Ddu64Core,a as DduSetSymbol}from'./chunk-VW2SZR2Z.js';export{m as Ddu64AdapterError,j as Ddu64CharsetError,i as Ddu64ChecksumError,e as Ddu64CompressionError,d as Ddu64DecodeError,f as Ddu64DecompressionError,h as Ddu64DecryptionError,c as Ddu64EncodeError,g as Ddu64EncryptionError,b as Ddu64Error,a as Ddu64ErrorCode,k as Ddu64InvalidInputError,l as Ddu64LimitError,n as Ddu64ObfuscationError,o as Ddu64StreamError,p as isDdu64Error}from'./chunk-IZK7KCU7.js';import {a}from'./chunk-EI7MMDWY.js';var s=class extends i{static{a(this,"Ddu64Node");}constructor(r,e,o){let t=b(r,e,o),a={...t.dduOptions,...t.dduChar!==void 0?{dduChar:t.dduChar}:{},...t.paddingChar!==void 0?{paddingChar:t.paddingChar}:{},obfuscationLayerFactory:t.dduOptions?.obfuscationLayerFactory??(c=>new a$1(c))};super(a);}encode(r,e){return super.encode(r,e)}encodeAsync(r,e){return super.encodeAsync(r,e)}decode(r,e){return super.decode(r,e)}decodeAsync(r,e){return super.decodeAsync(r,e)}decodeToUint8Array(r,e){return super.decodeToUint8Array(r,e)}decodeToUint8ArrayAsync(r,e){return super.decodeToUint8ArrayAsync(r,e)}getStats(r,e){return super.getStats(r,e)}getStatsAsync(r,e){return super.getStatsAsync(r,e)}decodeToBuffer(r,e){let o=this.decodeToUint8Array(r,e);return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}async decodeToBufferAsync(r,e){let o=await this.decodeToUint8ArrayAsync(r,e);return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}};export{s as Ddu64,s as Ddu64Node};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkLCOYWJWO_cjs=require('./chunk-LCOYWJWO.cjs'),chunkBDP7E7K3_cjs=require('./chunk-BDP7E7K3.cjs'),chunkJBUTKSCC_cjs=require('./chunk-JBUTKSCC.cjs'),chunkHUUB5BUS_cjs=require('./chunk-HUUB5BUS.cjs'),chunkZTGECGM2_cjs=require('./chunk-ZTGECGM2.cjs');require('./chunk-JY2ZPBJK.cjs');var chunkBCUBYE76_cjs=require('./chunk-BCUBYE76.cjs');async function I(){return new chunkHUUB5BUS_cjs.a}chunkBCUBYE76_cjs.a(I,"getAdapter");Object.defineProperty(exports,"Ddu64",{enumerable:true,get:function(){return chunkLCOYWJWO_cjs.a}});Object.defineProperty(exports,"Ddu64SecureBrowser",{enumerable:true,get:function(){return chunkLCOYWJWO_cjs.a}});Object.defineProperty(exports,"createReadableDecodeStream",{enumerable:true,get:function(){return chunkLCOYWJWO_cjs.c}});Object.defineProperty(exports,"createReadableEncodeStream",{enumerable:true,get:function(){return chunkLCOYWJWO_cjs.b}});Object.defineProperty(exports,"HangulObfuscationLayer",{enumerable:true,get:function(){return chunkBDP7E7K3_cjs.a}});Object.defineProperty(exports,"createEncoderObfuscationLayer",{enumerable:true,get:function(){return chunkBDP7E7K3_cjs.b}});Object.defineProperty(exports,"detectRuntime",{enumerable:true,get:function(){return chunkBDP7E7K3_cjs.c}});Object.defineProperty(exports,"CharsetBuilder",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.j}});Object.defineProperty(exports,"Ddu64Core",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.i}});Object.defineProperty(exports,"DduSetSymbol",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.a}});Object.defineProperty(exports,"BrowserAdapter",{enumerable:true,get:function(){return chunkHUUB5BUS_cjs.a}});Object.defineProperty(exports,"Ddu64AdapterError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.m}});Object.defineProperty(exports,"Ddu64CharsetError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.j}});Object.defineProperty(exports,"Ddu64ChecksumError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.i}});Object.defineProperty(exports,"Ddu64CompressionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.e}});Object.defineProperty(exports,"Ddu64DecodeError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.d}});Object.defineProperty(exports,"Ddu64DecompressionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.f}});Object.defineProperty(exports,"Ddu64DecryptionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.h}});Object.defineProperty(exports,"Ddu64EncodeError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.c}});Object.defineProperty(exports,"Ddu64EncryptionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.g}});Object.defineProperty(exports,"Ddu64Error",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.b}});Object.defineProperty(exports,"Ddu64ErrorCode",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.a}});Object.defineProperty(exports,"Ddu64InvalidInputError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.k}});Object.defineProperty(exports,"Ddu64LimitError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.l}});Object.defineProperty(exports,"Ddu64ObfuscationError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.n}});Object.defineProperty(exports,"Ddu64StreamError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.o}});Object.defineProperty(exports,"isDdu64Error",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.p}});exports.getAdapter=I;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { B as BrowserAdapter } from './WebStreams-CY9E19f5.cjs';
|
|
2
|
+
export { D as Ddu64, D as Ddu64SecureBrowser, c as createReadableDecodeStream, a as createReadableEncodeStream } from './WebStreams-CY9E19f5.cjs';
|
|
3
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, f as Ddu64AdapterError, g as Ddu64CharsetError, h as Ddu64ChecksumError, i as Ddu64CompressionError, D as Ddu64Core, j as Ddu64DecodeError, k as Ddu64DecompressionError, l as Ddu64DecryptionError, m as Ddu64EncodeError, n as Ddu64EncryptionError, o as Ddu64Error, p as Ddu64ErrorCode, q as Ddu64ErrorOptions, r as Ddu64InvalidInputError, s as Ddu64LimitError, t as Ddu64ObfuscationError, u as Ddu64Operation, v as Ddu64StreamError, a as DduBaseConstructorOptions, b as DduBaseOptions, A as DduConstructorOptions, c as DduEncodeStats, B as DduOptions, w as DduProgressInfo, F as DduSecureConstructorOptions, G as DduSecureOptions, x as DduSetSymbol, y as DduSetSymbolInput, H as DduStreamOptions, E as EncodingProfile, K as KeyDerivationAlgorithm, I as KeyDerivationOptions, O as ObfuscationLayer, P as PlatformAdapter, z as isDdu64Error } from './core-BsIwjJK-.cjs';
|
|
4
|
+
export { H as HangulObfuscationLayer, c as createEncoderObfuscationLayer, d as detectRuntime } from './ObfuscationLayer-4rCOCRWH.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Secure 진입점 (브라우저 조건 빌드).
|
|
8
|
+
*
|
|
9
|
+
* 압축(CompressionStream)·암호화(WebCrypto)·체크섬·Web Streams를 포함한 배터리
|
|
10
|
+
* 풀세트를 BrowserAdapter 기반으로 제공합니다. Node.js 내장 모듈(zlib/crypto)을
|
|
11
|
+
* 정적으로 import하지 않으므로 브라우저 번들에 끌려오지 않습니다.
|
|
12
|
+
*
|
|
13
|
+
* @module secure.browser
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
declare function getAdapter(): Promise<BrowserAdapter>;
|
|
18
|
+
|
|
19
|
+
export { BrowserAdapter, getAdapter };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { B as BrowserAdapter } from './WebStreams-C16QV2Dz.js';
|
|
2
|
+
export { D as Ddu64, D as Ddu64SecureBrowser, c as createReadableDecodeStream, a as createReadableEncodeStream } from './WebStreams-C16QV2Dz.js';
|
|
3
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, f as Ddu64AdapterError, g as Ddu64CharsetError, h as Ddu64ChecksumError, i as Ddu64CompressionError, D as Ddu64Core, j as Ddu64DecodeError, k as Ddu64DecompressionError, l as Ddu64DecryptionError, m as Ddu64EncodeError, n as Ddu64EncryptionError, o as Ddu64Error, p as Ddu64ErrorCode, q as Ddu64ErrorOptions, r as Ddu64InvalidInputError, s as Ddu64LimitError, t as Ddu64ObfuscationError, u as Ddu64Operation, v as Ddu64StreamError, a as DduBaseConstructorOptions, b as DduBaseOptions, A as DduConstructorOptions, c as DduEncodeStats, B as DduOptions, w as DduProgressInfo, F as DduSecureConstructorOptions, G as DduSecureOptions, x as DduSetSymbol, y as DduSetSymbolInput, H as DduStreamOptions, E as EncodingProfile, K as KeyDerivationAlgorithm, I as KeyDerivationOptions, O as ObfuscationLayer, P as PlatformAdapter, z as isDdu64Error } from './core-BsIwjJK-.js';
|
|
4
|
+
export { H as HangulObfuscationLayer, c as createEncoderObfuscationLayer, d as detectRuntime } from './ObfuscationLayer-DTlA723P.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Secure 진입점 (브라우저 조건 빌드).
|
|
8
|
+
*
|
|
9
|
+
* 압축(CompressionStream)·암호화(WebCrypto)·체크섬·Web Streams를 포함한 배터리
|
|
10
|
+
* 풀세트를 BrowserAdapter 기반으로 제공합니다. Node.js 내장 모듈(zlib/crypto)을
|
|
11
|
+
* 정적으로 import하지 않으므로 브라우저 번들에 끌려오지 않습니다.
|
|
12
|
+
*
|
|
13
|
+
* @module secure.browser
|
|
14
|
+
* @packageDocumentation
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
declare function getAdapter(): Promise<BrowserAdapter>;
|
|
18
|
+
|
|
19
|
+
export { BrowserAdapter, getAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as Ddu64,a as Ddu64SecureBrowser,c as createReadableDecodeStream,b as createReadableEncodeStream}from'./chunk-7KUEHTG2.js';export{a as HangulObfuscationLayer,b as createEncoderObfuscationLayer,c as detectRuntime}from'./chunk-6N7QYPEJ.js';export{j as CharsetBuilder,i as Ddu64Core,a as DduSetSymbol}from'./chunk-VW2SZR2Z.js';import {a as a$1}from'./chunk-6ZYMNHFT.js';export{a as BrowserAdapter}from'./chunk-6ZYMNHFT.js';export{m as Ddu64AdapterError,j as Ddu64CharsetError,i as Ddu64ChecksumError,e as Ddu64CompressionError,d as Ddu64DecodeError,f as Ddu64DecompressionError,h as Ddu64DecryptionError,c as Ddu64EncodeError,g as Ddu64EncryptionError,b as Ddu64Error,a as Ddu64ErrorCode,k as Ddu64InvalidInputError,l as Ddu64LimitError,n as Ddu64ObfuscationError,o as Ddu64StreamError,p as isDdu64Error}from'./chunk-IZK7KCU7.js';import'./chunk-Q6SCBUV2.js';import {a}from'./chunk-EI7MMDWY.js';async function I(){return new a$1}a(I,"getAdapter");export{I as getAdapter};
|
package/dist/secure.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkLCOYWJWO_cjs=require('./chunk-LCOYWJWO.cjs'),chunkBDP7E7K3_cjs=require('./chunk-BDP7E7K3.cjs'),chunkJBUTKSCC_cjs=require('./chunk-JBUTKSCC.cjs'),chunkHUUB5BUS_cjs=require('./chunk-HUUB5BUS.cjs'),chunkZTGECGM2_cjs=require('./chunk-ZTGECGM2.cjs'),chunk76X5J2OF_cjs=require('./chunk-76X5J2OF.cjs');require('./chunk-JY2ZPBJK.cjs');var chunkBCUBYE76_cjs=require('./chunk-BCUBYE76.cjs');var n=class extends chunkJBUTKSCC_cjs.i{static{chunkBCUBYE76_cjs.a(this,"Ddu64Secure");}constructor(r,t,e){let o=chunkJBUTKSCC_cjs.b(r,t,e),m={...o.dduOptions,...o.dduChar!==void 0?{dduChar:o.dduChar}:{},...o.paddingChar!==void 0?{paddingChar:o.paddingChar}:{},adapter:o.dduOptions?.adapter,adapterFactory:o.dduOptions?.adapterFactory??(()=>new chunk76X5J2OF_cjs.a),obfuscationLayerFactory:o.dduOptions?.obfuscationLayerFactory??(D=>new chunkBDP7E7K3_cjs.a(D))};super(m);}decodeToBuffer(r,t){let e=this.decodeToUint8Array(r,t);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}async decodeToBufferAsync(r,t){let e=await this.decodeToUint8ArrayAsync(r,t);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}};async function k(){let s=chunkBDP7E7K3_cjs.c();switch(s){case "node":{let{NodeAdapter:r}=await import('./NodeAdapter-4R7CNTHP.cjs');return new r}case "deno":case "bun":case "browser":case "edge":{let{BrowserAdapter:r}=await import('./BrowserAdapter-NWASGV3D.cjs');return new r(s)}default:throw new chunkZTGECGM2_cjs.m("[ddunigma] No suitable crypto provider found. Detected runtime lacks both Node.js crypto module and Web Crypto API (SubtleCrypto).","adapter")}}chunkBCUBYE76_cjs.a(k,"getAdapter");Object.defineProperty(exports,"Ddu64SecureBrowser",{enumerable:true,get:function(){return chunkLCOYWJWO_cjs.a}});Object.defineProperty(exports,"createReadableDecodeStream",{enumerable:true,get:function(){return chunkLCOYWJWO_cjs.c}});Object.defineProperty(exports,"createReadableEncodeStream",{enumerable:true,get:function(){return chunkLCOYWJWO_cjs.b}});Object.defineProperty(exports,"HangulObfuscationLayer",{enumerable:true,get:function(){return chunkBDP7E7K3_cjs.a}});Object.defineProperty(exports,"createEncoderObfuscationLayer",{enumerable:true,get:function(){return chunkBDP7E7K3_cjs.b}});Object.defineProperty(exports,"detectRuntime",{enumerable:true,get:function(){return chunkBDP7E7K3_cjs.c}});Object.defineProperty(exports,"CharsetBuilder",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.j}});Object.defineProperty(exports,"Ddu64Core",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.i}});Object.defineProperty(exports,"DduSetSymbol",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.a}});Object.defineProperty(exports,"BrowserAdapter",{enumerable:true,get:function(){return chunkHUUB5BUS_cjs.a}});Object.defineProperty(exports,"Ddu64AdapterError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.m}});Object.defineProperty(exports,"Ddu64CharsetError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.j}});Object.defineProperty(exports,"Ddu64ChecksumError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.i}});Object.defineProperty(exports,"Ddu64CompressionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.e}});Object.defineProperty(exports,"Ddu64DecodeError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.d}});Object.defineProperty(exports,"Ddu64DecompressionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.f}});Object.defineProperty(exports,"Ddu64DecryptionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.h}});Object.defineProperty(exports,"Ddu64EncodeError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.c}});Object.defineProperty(exports,"Ddu64EncryptionError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.g}});Object.defineProperty(exports,"Ddu64Error",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.b}});Object.defineProperty(exports,"Ddu64ErrorCode",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.a}});Object.defineProperty(exports,"Ddu64InvalidInputError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.k}});Object.defineProperty(exports,"Ddu64LimitError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.l}});Object.defineProperty(exports,"Ddu64ObfuscationError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.n}});Object.defineProperty(exports,"Ddu64StreamError",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.o}});Object.defineProperty(exports,"isDdu64Error",{enumerable:true,get:function(){return chunkZTGECGM2_cjs.p}});Object.defineProperty(exports,"NodeAdapter",{enumerable:true,get:function(){return chunk76X5J2OF_cjs.a}});exports.Ddu64=n;exports.Ddu64Secure=n;exports.getAdapter=k;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { D as Ddu64Core, F as DduSecureConstructorOptions, G as DduSecureOptions, P as PlatformAdapter, I as KeyDerivationOptions } from './core-BsIwjJK-.cjs';
|
|
2
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, f as Ddu64AdapterError, g as Ddu64CharsetError, h as Ddu64ChecksumError, i as Ddu64CompressionError, j as Ddu64DecodeError, k as Ddu64DecompressionError, l as Ddu64DecryptionError, m as Ddu64EncodeError, n as Ddu64EncryptionError, o as Ddu64Error, p as Ddu64ErrorCode, q as Ddu64ErrorOptions, r as Ddu64InvalidInputError, s as Ddu64LimitError, t as Ddu64ObfuscationError, u as Ddu64Operation, v as Ddu64StreamError, a as DduBaseConstructorOptions, b as DduBaseOptions, A as DduConstructorOptions, c as DduEncodeStats, B as DduOptions, w as DduProgressInfo, x as DduSetSymbol, y as DduSetSymbolInput, H as DduStreamOptions, E as EncodingProfile, K as KeyDerivationAlgorithm, O as ObfuscationLayer, z as isDdu64Error } from './core-BsIwjJK-.cjs';
|
|
3
|
+
export { B as BrowserAdapter, D as Ddu64SecureBrowser, c as createReadableDecodeStream, a as createReadableEncodeStream } from './WebStreams-CY9E19f5.cjs';
|
|
4
|
+
export { H as HangulObfuscationLayer, c as createEncoderObfuscationLayer, d as detectRuntime } from './ObfuscationLayer-4rCOCRWH.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Node.js 전용 secure Ddu64 래퍼.
|
|
8
|
+
*
|
|
9
|
+
* Ddu64Core를 확장하여 압축/암호화/체크섬(배터리 포함)과 Node.js Buffer를 지원합니다:
|
|
10
|
+
* - NodeAdapter 자동 주입 (zlib/crypto) → 압축/암호화/체크섬 사용 가능
|
|
11
|
+
* - HangulObfuscationLayer 자동 주입 → 한글 난독화 사용 가능
|
|
12
|
+
* - Node.js Buffer를 반환하는 `decodeToBuffer` 및 `decodeToBufferAsync` 제공
|
|
13
|
+
* - encode()에 Buffer 입력 허용 (Buffer는 Uint8Array를 확장)
|
|
14
|
+
*
|
|
15
|
+
* 구 `Ddu64Node`의 배터리 동작을 계승합니다. 6.0부터 기본 진입점(`@ddunigma/node`)은
|
|
16
|
+
* 인코딩 + 난독화만 제공하며, 압축/암호화/체크섬/스트림은 secure 진입점
|
|
17
|
+
* (`@ddunigma/node/secure`)으로 이전되었습니다.
|
|
18
|
+
*
|
|
19
|
+
* @module Ddu64Secure
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Node.js 전용 secure Ddu64 인코더/디코더.
|
|
24
|
+
*
|
|
25
|
+
* Ddu64Core를 래핑하여 자동 NodeAdapter 주입(압축/암호화/체크섬)과
|
|
26
|
+
* 하위 호환성을 위한 Buffer 반환 디코드 메서드를 제공합니다.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { Ddu64Secure } from '@ddunigma/node/secure';
|
|
31
|
+
*
|
|
32
|
+
* const encoder = new Ddu64Secure(undefined, undefined, { encryptionKey: 'key' });
|
|
33
|
+
* const encoded = encoder.encode(Buffer.from('Hello'), { compress: true });
|
|
34
|
+
* const decoded = encoder.decodeToBuffer(encoded); // Buffer 반환
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare class Ddu64Secure extends Ddu64Core {
|
|
38
|
+
constructor(dduChar?: string[] | string | DduSecureConstructorOptions, paddingChar?: string, dduOptions?: DduSecureConstructorOptions);
|
|
39
|
+
/**
|
|
40
|
+
* 인코딩된 문자열을 Node.js Buffer로 디코딩합니다.
|
|
41
|
+
*
|
|
42
|
+
* @param input - 디코딩할 인코딩된 문자열
|
|
43
|
+
* @param options - 디코딩 옵션
|
|
44
|
+
* @returns 디코딩된 Buffer
|
|
45
|
+
* @group Sync
|
|
46
|
+
*/
|
|
47
|
+
decodeToBuffer(input: string, options?: DduSecureOptions): Buffer;
|
|
48
|
+
/**
|
|
49
|
+
* 비동기적으로 Node.js Buffer로 디코딩합니다.
|
|
50
|
+
*
|
|
51
|
+
* @param input - 디코딩할 인코딩된 문자열
|
|
52
|
+
* @param options - 디코딩 옵션
|
|
53
|
+
* @returns 디코딩된 Buffer로 resolve되는 Promise
|
|
54
|
+
* @group Async
|
|
55
|
+
*/
|
|
56
|
+
decodeToBufferAsync(input: string, options?: DduSecureOptions): Promise<Buffer>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Node.js 플랫폼 어댑터 구현.
|
|
61
|
+
* Node.js `crypto`와 `zlib` 모듈을 래핑하여 PlatformAdapter 인터페이스를 구현합니다.
|
|
62
|
+
*
|
|
63
|
+
* @module adapters/NodeAdapter
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* PlatformAdapter의 Node.js 구현.
|
|
68
|
+
* 네이티브 Node.js `crypto`와 `zlib` 모듈을 사용하여
|
|
69
|
+
* 동기 및 비동기 암호화/압축 연산을 제공합니다.
|
|
70
|
+
*/
|
|
71
|
+
declare class NodeAdapter implements PlatformAdapter {
|
|
72
|
+
readonly runtime: "node";
|
|
73
|
+
deriveKey(key: string, options?: KeyDerivationOptions): Promise<Uint8Array>;
|
|
74
|
+
deriveKeySync(key: string, options?: KeyDerivationOptions): Uint8Array;
|
|
75
|
+
encrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
76
|
+
encryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
77
|
+
decrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
78
|
+
decryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
79
|
+
randomBytes(length: number): Uint8Array;
|
|
80
|
+
deflate(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
81
|
+
deflateSync(data: Uint8Array, level?: number): Uint8Array;
|
|
82
|
+
inflate(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
83
|
+
inflateSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
84
|
+
brotliCompress(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
85
|
+
brotliCompressSync(data: Uint8Array, level?: number): Uint8Array;
|
|
86
|
+
brotliDecompress(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
87
|
+
brotliDecompressSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 런타임 자동 감지 모듈.
|
|
92
|
+
* 현재 JavaScript 런타임 환경을 감지하고 적절한 PlatformAdapter를 반환합니다.
|
|
93
|
+
*
|
|
94
|
+
* 중요: 이 모듈은 Node.js 내장 모듈을 임포트하지 않습니다.
|
|
95
|
+
* 감지는 순수하게 globalThis 검사에 기반합니다.
|
|
96
|
+
*
|
|
97
|
+
* @module adapters/detect
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 현재 런타임에 적합한 PlatformAdapter를 가져옵니다.
|
|
102
|
+
*
|
|
103
|
+
* 실제로 필요할 때까지 플랫폼별 모듈을 임포트하지 않는
|
|
104
|
+
* 지연 로딩을 사용합니다.
|
|
105
|
+
*
|
|
106
|
+
* @returns 적절한 PlatformAdapter로 resolve되는 Promise
|
|
107
|
+
* @throws 적합한 런타임이 감지되지 않은 경우 에러
|
|
108
|
+
*/
|
|
109
|
+
declare function getAdapter(): Promise<PlatformAdapter>;
|
|
110
|
+
|
|
111
|
+
export { Ddu64Secure as Ddu64, Ddu64Core, Ddu64Secure, DduSecureConstructorOptions, DduSecureOptions, KeyDerivationOptions, NodeAdapter, PlatformAdapter, getAdapter };
|
package/dist/secure.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { D as Ddu64Core, F as DduSecureConstructorOptions, G as DduSecureOptions, P as PlatformAdapter, I as KeyDerivationOptions } from './core-BsIwjJK-.js';
|
|
2
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, f as Ddu64AdapterError, g as Ddu64CharsetError, h as Ddu64ChecksumError, i as Ddu64CompressionError, j as Ddu64DecodeError, k as Ddu64DecompressionError, l as Ddu64DecryptionError, m as Ddu64EncodeError, n as Ddu64EncryptionError, o as Ddu64Error, p as Ddu64ErrorCode, q as Ddu64ErrorOptions, r as Ddu64InvalidInputError, s as Ddu64LimitError, t as Ddu64ObfuscationError, u as Ddu64Operation, v as Ddu64StreamError, a as DduBaseConstructorOptions, b as DduBaseOptions, A as DduConstructorOptions, c as DduEncodeStats, B as DduOptions, w as DduProgressInfo, x as DduSetSymbol, y as DduSetSymbolInput, H as DduStreamOptions, E as EncodingProfile, K as KeyDerivationAlgorithm, O as ObfuscationLayer, z as isDdu64Error } from './core-BsIwjJK-.js';
|
|
3
|
+
export { B as BrowserAdapter, D as Ddu64SecureBrowser, c as createReadableDecodeStream, a as createReadableEncodeStream } from './WebStreams-C16QV2Dz.js';
|
|
4
|
+
export { H as HangulObfuscationLayer, c as createEncoderObfuscationLayer, d as detectRuntime } from './ObfuscationLayer-DTlA723P.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Node.js 전용 secure Ddu64 래퍼.
|
|
8
|
+
*
|
|
9
|
+
* Ddu64Core를 확장하여 압축/암호화/체크섬(배터리 포함)과 Node.js Buffer를 지원합니다:
|
|
10
|
+
* - NodeAdapter 자동 주입 (zlib/crypto) → 압축/암호화/체크섬 사용 가능
|
|
11
|
+
* - HangulObfuscationLayer 자동 주입 → 한글 난독화 사용 가능
|
|
12
|
+
* - Node.js Buffer를 반환하는 `decodeToBuffer` 및 `decodeToBufferAsync` 제공
|
|
13
|
+
* - encode()에 Buffer 입력 허용 (Buffer는 Uint8Array를 확장)
|
|
14
|
+
*
|
|
15
|
+
* 구 `Ddu64Node`의 배터리 동작을 계승합니다. 6.0부터 기본 진입점(`@ddunigma/node`)은
|
|
16
|
+
* 인코딩 + 난독화만 제공하며, 압축/암호화/체크섬/스트림은 secure 진입점
|
|
17
|
+
* (`@ddunigma/node/secure`)으로 이전되었습니다.
|
|
18
|
+
*
|
|
19
|
+
* @module Ddu64Secure
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Node.js 전용 secure Ddu64 인코더/디코더.
|
|
24
|
+
*
|
|
25
|
+
* Ddu64Core를 래핑하여 자동 NodeAdapter 주입(압축/암호화/체크섬)과
|
|
26
|
+
* 하위 호환성을 위한 Buffer 반환 디코드 메서드를 제공합니다.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { Ddu64Secure } from '@ddunigma/node/secure';
|
|
31
|
+
*
|
|
32
|
+
* const encoder = new Ddu64Secure(undefined, undefined, { encryptionKey: 'key' });
|
|
33
|
+
* const encoded = encoder.encode(Buffer.from('Hello'), { compress: true });
|
|
34
|
+
* const decoded = encoder.decodeToBuffer(encoded); // Buffer 반환
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare class Ddu64Secure extends Ddu64Core {
|
|
38
|
+
constructor(dduChar?: string[] | string | DduSecureConstructorOptions, paddingChar?: string, dduOptions?: DduSecureConstructorOptions);
|
|
39
|
+
/**
|
|
40
|
+
* 인코딩된 문자열을 Node.js Buffer로 디코딩합니다.
|
|
41
|
+
*
|
|
42
|
+
* @param input - 디코딩할 인코딩된 문자열
|
|
43
|
+
* @param options - 디코딩 옵션
|
|
44
|
+
* @returns 디코딩된 Buffer
|
|
45
|
+
* @group Sync
|
|
46
|
+
*/
|
|
47
|
+
decodeToBuffer(input: string, options?: DduSecureOptions): Buffer;
|
|
48
|
+
/**
|
|
49
|
+
* 비동기적으로 Node.js Buffer로 디코딩합니다.
|
|
50
|
+
*
|
|
51
|
+
* @param input - 디코딩할 인코딩된 문자열
|
|
52
|
+
* @param options - 디코딩 옵션
|
|
53
|
+
* @returns 디코딩된 Buffer로 resolve되는 Promise
|
|
54
|
+
* @group Async
|
|
55
|
+
*/
|
|
56
|
+
decodeToBufferAsync(input: string, options?: DduSecureOptions): Promise<Buffer>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Node.js 플랫폼 어댑터 구현.
|
|
61
|
+
* Node.js `crypto`와 `zlib` 모듈을 래핑하여 PlatformAdapter 인터페이스를 구현합니다.
|
|
62
|
+
*
|
|
63
|
+
* @module adapters/NodeAdapter
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* PlatformAdapter의 Node.js 구현.
|
|
68
|
+
* 네이티브 Node.js `crypto`와 `zlib` 모듈을 사용하여
|
|
69
|
+
* 동기 및 비동기 암호화/압축 연산을 제공합니다.
|
|
70
|
+
*/
|
|
71
|
+
declare class NodeAdapter implements PlatformAdapter {
|
|
72
|
+
readonly runtime: "node";
|
|
73
|
+
deriveKey(key: string, options?: KeyDerivationOptions): Promise<Uint8Array>;
|
|
74
|
+
deriveKeySync(key: string, options?: KeyDerivationOptions): Uint8Array;
|
|
75
|
+
encrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
76
|
+
encryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
77
|
+
decrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
78
|
+
decryptSync(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
79
|
+
randomBytes(length: number): Uint8Array;
|
|
80
|
+
deflate(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
81
|
+
deflateSync(data: Uint8Array, level?: number): Uint8Array;
|
|
82
|
+
inflate(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
83
|
+
inflateSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
84
|
+
brotliCompress(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
85
|
+
brotliCompressSync(data: Uint8Array, level?: number): Uint8Array;
|
|
86
|
+
brotliDecompress(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
87
|
+
brotliDecompressSync(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 런타임 자동 감지 모듈.
|
|
92
|
+
* 현재 JavaScript 런타임 환경을 감지하고 적절한 PlatformAdapter를 반환합니다.
|
|
93
|
+
*
|
|
94
|
+
* 중요: 이 모듈은 Node.js 내장 모듈을 임포트하지 않습니다.
|
|
95
|
+
* 감지는 순수하게 globalThis 검사에 기반합니다.
|
|
96
|
+
*
|
|
97
|
+
* @module adapters/detect
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 현재 런타임에 적합한 PlatformAdapter를 가져옵니다.
|
|
102
|
+
*
|
|
103
|
+
* 실제로 필요할 때까지 플랫폼별 모듈을 임포트하지 않는
|
|
104
|
+
* 지연 로딩을 사용합니다.
|
|
105
|
+
*
|
|
106
|
+
* @returns 적절한 PlatformAdapter로 resolve되는 Promise
|
|
107
|
+
* @throws 적합한 런타임이 감지되지 않은 경우 에러
|
|
108
|
+
*/
|
|
109
|
+
declare function getAdapter(): Promise<PlatformAdapter>;
|
|
110
|
+
|
|
111
|
+
export { Ddu64Secure as Ddu64, Ddu64Core, Ddu64Secure, DduSecureConstructorOptions, DduSecureOptions, KeyDerivationOptions, NodeAdapter, PlatformAdapter, getAdapter };
|
package/dist/secure.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as Ddu64SecureBrowser,c as createReadableDecodeStream,b as createReadableEncodeStream}from'./chunk-7KUEHTG2.js';import {a as a$1,c}from'./chunk-6N7QYPEJ.js';export{a as HangulObfuscationLayer,b as createEncoderObfuscationLayer,c as detectRuntime}from'./chunk-6N7QYPEJ.js';import {i,b}from'./chunk-VW2SZR2Z.js';export{j as CharsetBuilder,i as Ddu64Core,a as DduSetSymbol}from'./chunk-VW2SZR2Z.js';export{a as BrowserAdapter}from'./chunk-6ZYMNHFT.js';import {m}from'./chunk-IZK7KCU7.js';export{m as Ddu64AdapterError,j as Ddu64CharsetError,i as Ddu64ChecksumError,e as Ddu64CompressionError,d as Ddu64DecodeError,f as Ddu64DecompressionError,h as Ddu64DecryptionError,c as Ddu64EncodeError,g as Ddu64EncryptionError,b as Ddu64Error,a as Ddu64ErrorCode,k as Ddu64InvalidInputError,l as Ddu64LimitError,n as Ddu64ObfuscationError,o as Ddu64StreamError,p as isDdu64Error}from'./chunk-IZK7KCU7.js';import {a as a$2}from'./chunk-7EPVCA2F.js';export{a as NodeAdapter}from'./chunk-7EPVCA2F.js';import'./chunk-Q6SCBUV2.js';import {a}from'./chunk-EI7MMDWY.js';var n=class extends i{static{a(this,"Ddu64Secure");}constructor(r,t,e){let o=b(r,t,e),m={...o.dduOptions,...o.dduChar!==void 0?{dduChar:o.dduChar}:{},...o.paddingChar!==void 0?{paddingChar:o.paddingChar}:{},adapter:o.dduOptions?.adapter,adapterFactory:o.dduOptions?.adapterFactory??(()=>new a$2),obfuscationLayerFactory:o.dduOptions?.obfuscationLayerFactory??(D=>new a$1(D))};super(m);}decodeToBuffer(r,t){let e=this.decodeToUint8Array(r,t);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}async decodeToBufferAsync(r,t){let e=await this.decodeToUint8ArrayAsync(r,t);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}};async function k(){let s=c();switch(s){case "node":{let{NodeAdapter:r}=await import('./NodeAdapter-YP22CLUP.js');return new r}case "deno":case "bun":case "browser":case "edge":{let{BrowserAdapter:r}=await import('./BrowserAdapter-A6RBN4N3.js');return new r(s)}default:throw new m("[ddunigma] No suitable crypto provider found. Detected runtime lacks both Node.js crypto module and Web Crypto API (SubtleCrypto).","adapter")}}a(k,"getAdapter");export{n as Ddu64,n as Ddu64Secure,k as getAdapter};
|