@ddunigma/node 4.0.1 → 6.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/CHANGELOG.md +234 -0
- package/README.md +37 -379
- 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-DZiQGHMw.d.ts → WebStreams-C16QV2Dz.d.ts} +43 -83
- package/dist/{ObfuscationLayer-BRiyE5xu.d.cts → WebStreams-CY9E19f5.d.cts} +43 -83
- 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-DxOlTuHc.d.cts → core-BsIwjJK-.d.cts} +211 -112
- package/dist/{errors-DxOlTuHc.d.ts → core-BsIwjJK-.d.ts} +211 -112
- 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 +242 -0
- package/package.json +61 -16
- package/dist/BrowserAdapter-G4XORUQJ.js +0 -2
- package/dist/BrowserAdapter-LIUL744V.cjs +0 -2
- package/dist/NodeAdapter-AHALQ4DQ.js +0 -2
- package/dist/NodeAdapter-DS44MI5D.cjs +0 -2
- package/dist/chunk-342X2QEY.js +0 -2
- package/dist/chunk-65RDFQV7.js +0 -10
- package/dist/chunk-FACJ5LAG.cjs +0 -10
- package/dist/chunk-M7526IW7.js +0 -2
- package/dist/chunk-NY4FGVF3.cjs +0 -2
- package/dist/chunk-P7WJ2LOQ.js +0 -2
- package/dist/chunk-QR43FNIY.js +0 -2
- package/dist/chunk-RFBXQWSA.cjs +0 -2
- package/dist/chunk-RHVBUC4T.cjs +0 -2
- package/dist/chunk-WS6GB27C.cjs +0 -2
- package/dist/wasm/codec.wasm +0 -0
|
@@ -9,7 +9,13 @@ declare enum DduSetSymbol {
|
|
|
9
9
|
DDU_V1 = "ddu_v1",
|
|
10
10
|
ONECHARSET = "oneCharSet"
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* `dduSetSymbol` 옵션이 받는 입력 타입.
|
|
14
|
+
* `DduSetSymbol` enum 멤버 또는 그 문자열 리터럴(`"ddu" | "ddu_v1" | "oneCharSet"`)을 허용해,
|
|
15
|
+
* enum을 import하지 않고도 `{ dduSetSymbol: "ddu" }`처럼 타입 안전하게 지정할 수 있습니다.
|
|
16
|
+
* 런타임 값은 enum 값과 동일하므로 동작·와이어 포맷에 영향이 없습니다.
|
|
17
|
+
*/
|
|
18
|
+
type DduSetSymbolInput = DduSetSymbol | `${DduSetSymbol}`;
|
|
13
19
|
interface EncodingProfile {
|
|
14
20
|
/** 논리 심볼당 비트 수 */
|
|
15
21
|
bitLength: number;
|
|
@@ -49,8 +55,8 @@ interface CharSetInfo {
|
|
|
49
55
|
bitLength: number;
|
|
50
56
|
/** 2의 제곱수 charset 여부 */
|
|
51
57
|
usePowerOfTwo: boolean;
|
|
52
|
-
/** 문자열 인코딩 방식 */
|
|
53
|
-
encoding:
|
|
58
|
+
/** 문자열 인코딩 방식 (런타임은 항상 UTF-8) */
|
|
59
|
+
encoding: "utf-8";
|
|
54
60
|
/** 기본 압축 사용 여부 */
|
|
55
61
|
defaultCompress: boolean;
|
|
56
62
|
/** 기본 최대 디코딩 바이트 수 */
|
|
@@ -63,6 +69,12 @@ interface CharSetInfo {
|
|
|
63
69
|
hasEncryptionKey: boolean;
|
|
64
70
|
/** 기본 체크섬 사용 여부 */
|
|
65
71
|
defaultChecksum: boolean;
|
|
72
|
+
/** 기본 체크섬 계산 범위 (5.0: "output") */
|
|
73
|
+
defaultChecksumScope: "plaintext" | "output";
|
|
74
|
+
/** 기본 난독화 사용 여부 */
|
|
75
|
+
defaultObfuscate: boolean;
|
|
76
|
+
/** 암호화 키가 있을 때 암호화 payload만 허용하는지 여부 */
|
|
77
|
+
defaultRequireEncryption: boolean;
|
|
66
78
|
/** 기본 청크 크기 */
|
|
67
79
|
defaultChunkSize: number | undefined;
|
|
68
80
|
/** 기본 청크 구분자 */
|
|
@@ -103,12 +115,13 @@ interface DduEncodeStats {
|
|
|
103
115
|
type KeyDerivationAlgorithm = "sha256" | "pbkdf2";
|
|
104
116
|
interface KeyDerivationOptions {
|
|
105
117
|
/**
|
|
106
|
-
* Key derivation algorithm. Defaults to `
|
|
118
|
+
* Key derivation algorithm. Defaults to `pbkdf2` (5.0).
|
|
107
119
|
*
|
|
108
|
-
* ⚠️
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* for high-entropy keys (e.g. 32 random bytes) or
|
|
120
|
+
* ⚠️ Migration: 4.x defaulted to `sha256`. Data encrypted with 4.x defaults must be decrypted with
|
|
121
|
+
* `algorithm: "sha256"` explicitly (key derivation is NOT self-described in the wire format).
|
|
122
|
+
* For low-entropy keys (human passwords), keep the `pbkdf2` default and provide an
|
|
123
|
+
* application-specific `salt`. Use `sha256` only for high-entropy keys (e.g. 32 random bytes) or
|
|
124
|
+
* legacy data compatibility.
|
|
112
125
|
*/
|
|
113
126
|
algorithm?: KeyDerivationAlgorithm;
|
|
114
127
|
/**
|
|
@@ -122,35 +135,80 @@ interface KeyDerivationOptions {
|
|
|
122
135
|
/** Hash function used by PBKDF2. */
|
|
123
136
|
hash?: "SHA-256" | "SHA-384" | "SHA-512";
|
|
124
137
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
compressionAlgorithm?: "deflate" | "brotli";
|
|
132
|
-
/** 압축 레벨 (deflate 기본값: 6, brotli도 기본값 6을 사용하며 전달값은 0~11 범위로 보정) */
|
|
133
|
-
compressionLevel?: number;
|
|
138
|
+
/**
|
|
139
|
+
* 기본(Base) 런타임 옵션 — 기본 진입점(`@ddunigma/node`, `@ddunigma/node/browser`)이
|
|
140
|
+
* 공개하는 옵션 표면. 인코딩 + 한글 난독화(재미 풀세트)에 필요한 옵션만 포함하며
|
|
141
|
+
* 압축/암호화/체크섬 같은 secure 부가기능은 포함하지 않습니다.
|
|
142
|
+
*/
|
|
143
|
+
interface DduBaseOptions {
|
|
134
144
|
/** 최대 디코딩 바이트 수 (Zip Bomb 방어) */
|
|
135
145
|
maxDecodedBytes?: number;
|
|
146
|
+
/**
|
|
147
|
+
* 최대 디코딩 입력(인코딩 문자열) 길이(문자 수). 청크/개행 제거 등 전처리 이전에
|
|
148
|
+
* 선검사하여 거대한 입력에 의한 한도 우회·대량 할당을 차단합니다. 기본값은
|
|
149
|
+
* `maxDecodedBytes`에 비례합니다.
|
|
150
|
+
*/
|
|
151
|
+
maxEncodedChars?: number;
|
|
136
152
|
/** 최대 압축해제 바이트 수 (Zip Bomb 방어) */
|
|
137
153
|
maxDecompressedBytes?: number;
|
|
138
|
-
/**
|
|
139
|
-
checksum?: boolean;
|
|
140
|
-
/** 청크 분할 크기 */
|
|
154
|
+
/** 청크 분할 크기 (0이면 청킹 비활성화 — 생성자 기본값을 호출 단위로 끌 때 사용) */
|
|
141
155
|
chunkSize?: number;
|
|
142
156
|
/** 청크 구분자 (기본값: '\n') */
|
|
143
157
|
chunkSeparator?: string;
|
|
144
|
-
/** 중간 스트림 청크처럼 푸터를 생략해야 할 때 사용 */
|
|
145
|
-
omitFooter?: boolean;
|
|
146
158
|
/** 진행률 콜백 */
|
|
147
159
|
onProgress?: (info: DduProgressInfo) => void;
|
|
148
|
-
/** 한글 난독화 활성화 (
|
|
160
|
+
/** 한글 난독화 활성화 (6.0: 암호화 키와 무관하게 동작) */
|
|
149
161
|
obfuscate?: boolean;
|
|
150
162
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Secure 확장 옵션 — secure 진입점(`@ddunigma/node/secure`)이 공개하는 옵션 표면.
|
|
165
|
+
* `DduBaseOptions`를 확장하며 압축/암호화/체크섬 부가기능 옵션을 추가합니다.
|
|
166
|
+
*/
|
|
167
|
+
interface DduSecureOptions extends DduBaseOptions {
|
|
168
|
+
/** 압축 사용 여부 (zlib deflate 또는 brotli) */
|
|
169
|
+
compress?: boolean;
|
|
170
|
+
/** 압축 알고리즘 (기본값: "deflate") */
|
|
171
|
+
compressionAlgorithm?: "deflate" | "brotli";
|
|
172
|
+
/** 압축 레벨 (deflate 기본값: 6, brotli도 기본값 6을 사용하며 전달값은 0~11 범위로 보정) */
|
|
173
|
+
compressionLevel?: number;
|
|
174
|
+
/** 체크섬 추가 여부 (CRC32) */
|
|
175
|
+
checksum?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* 체크섬 계산 범위 (기본값: "output").
|
|
178
|
+
* - `"plaintext"`: 원본 입력 바이트의 CRC32 (레거시 범위). 암호화와 함께 쓰면 평문 CRC가 출력에 노출됩니다.
|
|
179
|
+
* - `"output"`: 인코딩 파이프라인 최종 바이트(압축/암호화 후, 와이어에 실리는 바이트)의 CRC32.
|
|
180
|
+
* 암호화 시 평문 CRC를 노출하지 않고, 복호화 이전에 전송 손상을 감지합니다.
|
|
181
|
+
*
|
|
182
|
+
* `checksum`과 마찬가지로 와이어에 자기기술 플래그가 없으므로 인코딩/디코딩에서 동일하게 지정해야 합니다.
|
|
183
|
+
*/
|
|
184
|
+
checksumScope?: "plaintext" | "output";
|
|
185
|
+
/**
|
|
186
|
+
* 암호화 키가 설정된 decoder에서 암호화 footer를 요구합니다.
|
|
187
|
+
* 기본값은 encryptionKey가 있으면 true입니다. 레거시 평문을 같은 인스턴스로
|
|
188
|
+
* 디코딩해야 하면 false 또는 호출별 `requireEncryption: false`를 명시하세요.
|
|
189
|
+
*/
|
|
190
|
+
requireEncryption?: boolean;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* 하위호환 별칭. 6.0 이전 코드 및 코어 내부 시그니처가 사용하던 전 기능 런타임 옵션
|
|
194
|
+
* 타입으로, secure 표면 전체(`DduSecureOptions`)와 동일합니다. 코어는 계속 전 기능
|
|
195
|
+
* 타입으로 동작하며, 진입점별 공개 표면은 `DduBaseOptions`/`DduSecureOptions`로 분리됩니다.
|
|
196
|
+
*/
|
|
197
|
+
type DduOptions = DduSecureOptions;
|
|
198
|
+
/** Web Streams 버퍼 제한을 포함한 스트림 전용 옵션 */
|
|
199
|
+
interface DduStreamOptions extends DduSecureOptions {
|
|
200
|
+
/** 압축/암호화/체크섬 인코딩 시 메모리에 축적할 최대 입력 바이트 수 */
|
|
201
|
+
maxBufferedBytes?: number;
|
|
202
|
+
/** 디코딩 시 메모리에 축적할 최대 입력 문자 수 */
|
|
203
|
+
maxBufferedChars?: number;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* 기본(Base) 생성자 옵션 — charset/padding/urlSafe 계열과 Base 런타임 옵션을 포함합니다.
|
|
207
|
+
* 기본 진입점 래퍼(`Ddu64Node`/`Ddu64Browser`)의 생성자 표면입니다.
|
|
208
|
+
*/
|
|
209
|
+
interface DduBaseConstructorOptions extends DduBaseOptions {
|
|
210
|
+
/** 미리 정의된 charset 심볼 (enum 멤버 또는 그 문자열 리터럴) */
|
|
211
|
+
dduSetSymbol?: DduSetSymbolInput;
|
|
154
212
|
/** 커스텀 charset 문자 배열 또는 문자열 */
|
|
155
213
|
dduChar?: string[] | string;
|
|
156
214
|
/** 종성 문자 배열 (dduChar × codaChar 조합으로 최종 charset 동적 생성) */
|
|
@@ -163,22 +221,53 @@ interface DduConstructorOptions extends DduOptions {
|
|
|
163
221
|
usePowerOfTwo?: boolean;
|
|
164
222
|
/**
|
|
165
223
|
* true이면 초기화 오류 시 throw합니다. false이면 fallback charset으로 대체합니다.
|
|
166
|
-
*
|
|
224
|
+
*
|
|
225
|
+
* ⚠️ 5.0 변경: 기본값이 `false` → `true`로 전환되었습니다. 잘못된 커스텀 charset에
|
|
226
|
+
* 더 엄격하게 동작하며, 레거시의 묵시적 fallback 동작이 필요하면 `false`를 명시하세요.
|
|
227
|
+
* @default true
|
|
167
228
|
*/
|
|
168
229
|
throwOnError?: boolean;
|
|
169
230
|
/** URL-Safe 모드 (특수문자를 URL 안전 문자로 변환) */
|
|
170
231
|
urlSafe?: boolean;
|
|
232
|
+
/** 패딩 문자 반복 방식 사용 여부 */
|
|
233
|
+
useRepeatPadding?: boolean;
|
|
234
|
+
/**
|
|
235
|
+
* 난독화 레이어 팩토리 (지연 생성). 코어를 구체 난독화 구현과 분리하기 위한 주입점입니다.
|
|
236
|
+
* `obfuscate`가 실제로 사용될 때만 호출됩니다. 미주입 상태에서 난독화를 요청하면 throw합니다.
|
|
237
|
+
*
|
|
238
|
+
* Ddu64Node/Ddu64Browser가 HangulObfuscationLayer 팩토리를 주입하므로 일반 사용자는
|
|
239
|
+
* 신경 쓸 필요가 없습니다. `@ddunigma/node/core`로 Ddu64Core를 직접 쓰면서 난독화가
|
|
240
|
+
* 필요하면 이 팩토리를 주입하세요(미사용 시 난독화 코드가 번들에서 트리셰이킹됩니다).
|
|
241
|
+
* @internal
|
|
242
|
+
*/
|
|
243
|
+
obfuscationLayerFactory?: (alphabet: string[]) => ObfuscationLayer;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Secure 생성자 옵션 — Base 생성자 옵션 + Secure 런타임 옵션에 암호화 키/어댑터를 더한,
|
|
247
|
+
* 코어가 사용하는 전 기능 생성자 표면입니다. secure 진입점 래퍼(`Ddu64Secure` 계열)가 사용합니다.
|
|
248
|
+
*/
|
|
249
|
+
interface DduSecureConstructorOptions extends DduBaseConstructorOptions, DduSecureOptions {
|
|
171
250
|
/** 암호화 키 (AES-256-GCM) */
|
|
172
251
|
encryptionKey?: string;
|
|
173
252
|
/** 암호화 키 파생 옵션 */
|
|
174
253
|
keyDerivation?: KeyDerivationOptions;
|
|
175
|
-
/** 패딩 문자 반복 방식 사용 여부 */
|
|
176
|
-
useRepeatPadding?: boolean;
|
|
177
254
|
/** 명시적 플랫폼 어댑터 (자동 감지 대신 사용) */
|
|
178
255
|
adapter?: PlatformAdapter;
|
|
179
|
-
/**
|
|
180
|
-
|
|
256
|
+
/**
|
|
257
|
+
* 플랫폼 어댑터 팩토리 (지연 생성). `adapter`가 지정되지 않았을 때, 첫 압축/암호화
|
|
258
|
+
* 연산 시점에 한 번 호출되어 어댑터를 생성·캐시합니다. 순수 인코딩/디코딩만 수행하면
|
|
259
|
+
* 어댑터는 생성되지 않습니다.
|
|
260
|
+
*
|
|
261
|
+
* Ddu64Secure/Ddu64SecureBrowser가 각각 NodeAdapter/BrowserAdapter 팩토리를 주입합니다.
|
|
262
|
+
* @internal
|
|
263
|
+
*/
|
|
264
|
+
adapterFactory?: () => PlatformAdapter;
|
|
181
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* 하위호환 별칭. 6.0 이전 코드 및 코어 내부 시그니처가 사용하던 전 기능 생성자 옵션
|
|
268
|
+
* 타입으로, secure 생성자 표면 전체(`DduSecureConstructorOptions`)와 동일합니다.
|
|
269
|
+
*/
|
|
270
|
+
type DduConstructorOptions = DduSecureConstructorOptions;
|
|
182
271
|
/**
|
|
183
272
|
* 암호화 및 압축 연산을 제공하는 플랫폼 어댑터 인터페이스.
|
|
184
273
|
* 각 런타임(Node.js, 브라우저, 엣지)이 이 인터페이스를 구현합니다.
|
|
@@ -199,8 +288,14 @@ interface PlatformAdapter {
|
|
|
199
288
|
decrypt(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Promise<Uint8Array>;
|
|
200
289
|
/** 동기적으로 데이터를 복호화 (Node.js 전용) */
|
|
201
290
|
decryptSync?(data: Uint8Array, keyHash: Uint8Array, aad?: Uint8Array): Uint8Array;
|
|
202
|
-
/**
|
|
203
|
-
|
|
291
|
+
/**
|
|
292
|
+
* 암호학적으로 안전한 랜덤 바이트를 생성하는 편의 메서드.
|
|
293
|
+
*
|
|
294
|
+
* @remarks 코어 인코딩/디코딩 파이프라인은 이 메서드를 호출하지 않습니다(각 어댑터가
|
|
295
|
+
* 암호화 IV를 내부에서 직접 생성). 6.0부터 **선택(optional)** 이므로 커스텀 어댑터는
|
|
296
|
+
* 구현하지 않아도 됩니다. `NodeAdapter`/`BrowserAdapter`는 편의상 계속 제공합니다.
|
|
297
|
+
*/
|
|
298
|
+
randomBytes?(length: number): Uint8Array;
|
|
204
299
|
/** deflate 알고리즘으로 데이터를 압축 */
|
|
205
300
|
deflate(data: Uint8Array, level?: number): Promise<Uint8Array>;
|
|
206
301
|
/** 동기적으로 deflate 압축 (Node.js 전용) */
|
|
@@ -217,30 +312,9 @@ interface PlatformAdapter {
|
|
|
217
312
|
brotliDecompress?(data: Uint8Array, maxBytes?: number): Promise<Uint8Array>;
|
|
218
313
|
/** 동기적으로 brotli 데이터를 압축 해제 (Node.js 전용) */
|
|
219
314
|
brotliDecompressSync?(data: Uint8Array, maxBytes?: number): Uint8Array;
|
|
220
|
-
/** 이 어댑터가 동기 암호화 연산을 지원하는지 여부 */
|
|
221
|
-
readonly supportsSyncCrypto: boolean;
|
|
222
|
-
/** 이 어댑터가 동기 압축 연산을 지원하는지 여부 */
|
|
223
|
-
readonly supportsSyncCompression: boolean;
|
|
224
|
-
/** 이 어댑터가 brotli 압축을 지원하는지 여부 */
|
|
225
|
-
readonly supportsBrotli: boolean;
|
|
226
315
|
/** 감지된 런타임 환경 */
|
|
227
316
|
readonly runtime: "node" | "browser" | "edge" | "deno" | "bun" | "unknown";
|
|
228
317
|
}
|
|
229
|
-
/**
|
|
230
|
-
* WASM 가속 비트 패킹 코덱 인터페이스.
|
|
231
|
-
* 순수 JavaScript 구현과 바이트 단위로 동일한 인코딩/디코딩 연산을 제공합니다.
|
|
232
|
-
*/
|
|
233
|
-
interface WasmCodec {
|
|
234
|
-
/** 바이트를 charset 인덱스로 인코딩 */
|
|
235
|
-
encode(input: Uint8Array, bitLength: number): {
|
|
236
|
-
indices: Uint16Array;
|
|
237
|
-
paddingBits: number;
|
|
238
|
-
};
|
|
239
|
-
/** charset 인덱스를 바이트로 디코딩 */
|
|
240
|
-
decode(indices: Uint16Array, bitLength: number, paddingBits: number): Uint8Array;
|
|
241
|
-
/** WASM 모듈이 초기화되어 사용 가능한지 확인 */
|
|
242
|
-
readonly ready: boolean;
|
|
243
|
-
}
|
|
244
318
|
/**
|
|
245
319
|
* 한글 음절 난독화 레이어 인터페이스.
|
|
246
320
|
* 암호화된 출력을 자연스러운 한국어 음절 블록으로 변환합니다.
|
|
@@ -257,54 +331,6 @@ interface ObfuscationLayer {
|
|
|
257
331
|
*/
|
|
258
332
|
deobfuscate(input: string): string;
|
|
259
333
|
}
|
|
260
|
-
/**
|
|
261
|
-
* 크로스 플랫폼 인코딩 호환성 및 와이어 포맷 적합성을 검증하기 위한
|
|
262
|
-
* 표준화된 테스트 벡터 형식.
|
|
263
|
-
*/
|
|
264
|
-
interface TestVector {
|
|
265
|
-
/** 이 테스트 벡터의 고유 식별자 */
|
|
266
|
-
id: string;
|
|
267
|
-
/** 이 벡터가 테스트하는 내용에 대한 설명 */
|
|
268
|
-
description: string;
|
|
269
|
-
/** 입력 데이터 명세 */
|
|
270
|
-
input: {
|
|
271
|
-
/** 16진수 인코딩된 입력 바이트 */
|
|
272
|
-
raw: string;
|
|
273
|
-
/** 원시 데이터의 인코딩 */
|
|
274
|
-
encoding: "utf-8" | "binary";
|
|
275
|
-
};
|
|
276
|
-
/** 이 벡터의 charset 설정 */
|
|
277
|
-
charset: {
|
|
278
|
-
/** 프리셋 심볼 (내장 charset 사용 시) */
|
|
279
|
-
preset?: DduSetSymbol;
|
|
280
|
-
/** 커스텀 charset 문자 (프리셋 미사용 시) */
|
|
281
|
-
dduChar?: string[];
|
|
282
|
-
/** 조합 charset용 종성 문자 */
|
|
283
|
-
codaChar?: string[];
|
|
284
|
-
/** 패딩 문자 */
|
|
285
|
-
paddingChar: string;
|
|
286
|
-
};
|
|
287
|
-
/** 인코딩 옵션 */
|
|
288
|
-
options: {
|
|
289
|
-
compress?: boolean;
|
|
290
|
-
compressionAlgorithm?: "deflate" | "brotli";
|
|
291
|
-
encrypt?: boolean;
|
|
292
|
-
encryptionKey?: string;
|
|
293
|
-
checksum?: boolean;
|
|
294
|
-
urlSafe?: boolean;
|
|
295
|
-
chunkSize?: number;
|
|
296
|
-
useRepeatPadding?: boolean;
|
|
297
|
-
};
|
|
298
|
-
/** 기대 출력 */
|
|
299
|
-
expected: {
|
|
300
|
-
/** 기대되는 인코딩 문자열 */
|
|
301
|
-
encoded: string;
|
|
302
|
-
/** 바이너리 비교를 위한 16진수 표현 */
|
|
303
|
-
encodedHex?: string;
|
|
304
|
-
};
|
|
305
|
-
/** 테스트 벡터 분류 태그 */
|
|
306
|
-
tags: string[];
|
|
307
|
-
}
|
|
308
334
|
|
|
309
335
|
/**
|
|
310
336
|
* 플랫폼 독립 Ddu64 인코더/디코더 코어.
|
|
@@ -331,12 +357,14 @@ declare class Ddu64Core {
|
|
|
331
357
|
protected readonly usePowerOfTwo: boolean;
|
|
332
358
|
/** UTF-16 코드 유닛 → 인덱스 direct lookup (단일 BMP 심볼 전용) */
|
|
333
359
|
private readonly dduCharCodeLookup;
|
|
334
|
-
/**
|
|
335
|
-
private readonly
|
|
360
|
+
/** 룩업 테이블 오프셋 (lookup[code - offset]) */
|
|
361
|
+
private readonly dduCharCodeLookupOffset;
|
|
336
362
|
/** 기본 압축 활성화 */
|
|
337
363
|
protected readonly defaultCompress: boolean;
|
|
338
364
|
/** 기본 최대 디코딩 바이트 수 */
|
|
339
365
|
private readonly defaultMaxDecodedBytes;
|
|
366
|
+
/** 기본 최대 인코딩 입력 문자 수 (디코드 전처리 전 선검사) */
|
|
367
|
+
private readonly defaultMaxEncodedChars;
|
|
340
368
|
/** 기본 최대 압축해제 바이트 수 */
|
|
341
369
|
private readonly defaultMaxDecompressedBytes;
|
|
342
370
|
/** URL-Safe 모드 */
|
|
@@ -347,8 +375,12 @@ declare class Ddu64Core {
|
|
|
347
375
|
private readonly keyDerivation;
|
|
348
376
|
/** 캐시된 암호화 키 해시 */
|
|
349
377
|
private encryptionKeyHash;
|
|
378
|
+
/** 캐시된 어댑터 게이트웨이 컨텍스트 (호출당 재할당 방지, 해시는 getter로 라이브 조회) */
|
|
379
|
+
private syncGatewayContext;
|
|
350
380
|
/** 기본 체크섬 활성화 */
|
|
351
381
|
private readonly defaultChecksum;
|
|
382
|
+
/** 기본 체크섬 계산 범위 */
|
|
383
|
+
private readonly defaultChecksumScope;
|
|
352
384
|
/** 기본 청크 크기 */
|
|
353
385
|
private readonly defaultChunkSize;
|
|
354
386
|
/** 기본 청크 구분자 */
|
|
@@ -363,18 +395,37 @@ declare class Ddu64Core {
|
|
|
363
395
|
private readonly bitsPerPadChar;
|
|
364
396
|
/** BitPack 설정 */
|
|
365
397
|
private readonly bitPackConfig;
|
|
366
|
-
/** WASM 사용 임계값 */
|
|
367
|
-
private readonly wasmThreshold;
|
|
368
398
|
/** 표준 Base64 charset에서 네이티브 Base64 fast path 사용 여부 */
|
|
369
399
|
private readonly canUseNativeBase64;
|
|
370
400
|
/** 인코딩/디코딩 payload codec 공유 컨텍스트 */
|
|
371
401
|
private readonly payloadCodecContext;
|
|
372
402
|
/** 플랫폼 어댑터 (동기용 지연 로드 또는 명시적 제공) */
|
|
373
403
|
private adapter;
|
|
404
|
+
/** 어댑터 지연 생성 팩토리 (adapter 미지정 시 첫 암/복호화·압축 시점에 1회 호출) */
|
|
405
|
+
private readonly adapterFactory;
|
|
406
|
+
/** 난독화 레이어 팩토리 (코어-난독화 분리용 주입점) */
|
|
407
|
+
private readonly obfuscationLayerFactory;
|
|
374
408
|
/** 기본 난독화 활성화 */
|
|
375
409
|
private readonly defaultObfuscate;
|
|
410
|
+
/** 기본 진행률 콜백 */
|
|
411
|
+
private readonly defaultOnProgress;
|
|
412
|
+
/** 암호화 키가 설정된 decoder에서 암호화 footer 요구 */
|
|
413
|
+
private readonly defaultRequireEncryption;
|
|
376
414
|
/** 지연 초기화되는 난독화 레이어 */
|
|
377
415
|
private obfuscationLayer;
|
|
416
|
+
/**
|
|
417
|
+
* Ddu64 인코더/디코더를 생성합니다.
|
|
418
|
+
*
|
|
419
|
+
* 권장: 옵션 객체 단일 인자 형태 — `new Ddu64({ dduSetSymbol, compress, ... })`.
|
|
420
|
+
*
|
|
421
|
+
* 위치 인자 형태 `new Ddu64(dduChar, paddingChar, options)`는 커스텀 charset
|
|
422
|
+
* 지정용으로 계속 지원되지만, 가독성을 위해 옵션 객체 형태를 우선 권장합니다.
|
|
423
|
+
* (`new Ddu64(charset, padding, options)` 또는 `new Ddu64({ dduChar, paddingChar, ...options })`)
|
|
424
|
+
*
|
|
425
|
+
* @param dduChar - 커스텀 charset(문자열/배열) 또는 옵션 객체
|
|
426
|
+
* @param paddingChar - 패딩 문자 (커스텀 charset 사용 시 필수)
|
|
427
|
+
* @param dduOptions - 추가 옵션
|
|
428
|
+
*/
|
|
378
429
|
constructor(dduChar?: string[] | string | DduConstructorOptions, paddingChar?: string, dduOptions?: DduConstructorOptions);
|
|
379
430
|
/**
|
|
380
431
|
* 입력 데이터를 charset 인코딩 문자열로 인코딩합니다.
|
|
@@ -425,6 +476,11 @@ declare class Ddu64Core {
|
|
|
425
476
|
*/
|
|
426
477
|
decodeToUint8ArrayAsync(input: string, options?: DduOptions): Promise<Uint8Array>;
|
|
427
478
|
private decodeToUint8ArrayAsyncInternal;
|
|
479
|
+
/**
|
|
480
|
+
* 동기/비동기 디코딩 파이프라인이 공유하는 기본 컨텍스트를 구성합니다.
|
|
481
|
+
* decrypt/decompress만 동기/비동기 구현에서 각각 덧붙입니다.
|
|
482
|
+
*/
|
|
483
|
+
private buildDecodeBaseContext;
|
|
428
484
|
/**
|
|
429
485
|
* charset 정보를 가져옵니다.
|
|
430
486
|
*
|
|
@@ -437,10 +493,37 @@ declare class Ddu64Core {
|
|
|
437
493
|
* @group Introspection
|
|
438
494
|
*/
|
|
439
495
|
getStats(input: Uint8Array | string, options?: DduOptions): DduEncodeStats;
|
|
496
|
+
/**
|
|
497
|
+
* 비동기 인코딩 통계를 가져옵니다.
|
|
498
|
+
*
|
|
499
|
+
* 브라우저/Workers처럼 압축이 비동기 API로만 제공되는 런타임에서는 `compress: true`
|
|
500
|
+
* 통계 계산에 이 메서드를 사용하세요.
|
|
501
|
+
*
|
|
502
|
+
* @group Introspection
|
|
503
|
+
*/
|
|
504
|
+
getStatsAsync(input: Uint8Array | string, options?: DduOptions): Promise<DduEncodeStats>;
|
|
505
|
+
private buildEncodeStats;
|
|
440
506
|
/**
|
|
441
507
|
* 통계를 위한 메타데이터 포함 내부 인코딩.
|
|
442
508
|
*/
|
|
443
509
|
private encodeInternal;
|
|
510
|
+
/**
|
|
511
|
+
* getStats 전용 인코딩: 실제 AES-GCM 연산을 생략하고 길이만 정확한 더미 암호화를 사용합니다.
|
|
512
|
+
*
|
|
513
|
+
* 암호화 출력 길이는 `평문 + AEAD_OVERHEAD_BYTES`로 결정적이고, 비트팩/푸터/체크섬/난독화/
|
|
514
|
+
* URL-safe/청킹은 모두 입력 바이트 "길이"에만 의존(바이트 "값"과 무관)하므로, 더미 암호문(0으로 채운
|
|
515
|
+
* 동일 길이 버퍼)으로 마무리해도 `encoded.length`는 실제 `encode()` 출력과 바이트 단위로 일치합니다.
|
|
516
|
+
* 압축은 결과 크기와 적용 여부 판단에 필요하므로 실제로 수행합니다.
|
|
517
|
+
*
|
|
518
|
+
* 이 등식(통계 길이 === 실제 encode 길이)은 property test로 고정됩니다.
|
|
519
|
+
*/
|
|
520
|
+
private encodeStatsInternal;
|
|
521
|
+
private encodeStatsAsyncInternal;
|
|
522
|
+
/**
|
|
523
|
+
* 동기/비동기 인코딩 파이프라인이 공유하는 기본 컨텍스트를 구성합니다.
|
|
524
|
+
* compress/encrypt만 동기/비동기 구현에서 각각 덧붙입니다.
|
|
525
|
+
*/
|
|
526
|
+
private buildEncodeBaseContext;
|
|
444
527
|
/**
|
|
445
528
|
* 인코딩 마무리: 비트팩 인코딩 + 후처리(난독화/체크섬/URL-safe/청킹).
|
|
446
529
|
* 동기/비동기 인코딩에서 공유하는 순수 동기 단계입니다.
|
|
@@ -458,10 +541,11 @@ declare class Ddu64Core {
|
|
|
458
541
|
private decodePrelude;
|
|
459
542
|
private getPayloadCodecContext;
|
|
460
543
|
private reportProgress;
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
544
|
+
/**
|
|
545
|
+
* 어댑터를 지연 해석합니다. 명시적 adapter가 없고 adapterFactory가 있으면 첫 호출 시
|
|
546
|
+
* 1회 생성·캐시합니다. 순수 인코딩/디코딩 경로에서는 호출되지 않습니다.
|
|
547
|
+
*/
|
|
548
|
+
private getAdapter;
|
|
465
549
|
private getSyncGatewayContext;
|
|
466
550
|
/**
|
|
467
551
|
* 난독화 레이어를 가져오거나 생성합니다 (지연 초기화).
|
|
@@ -471,7 +555,7 @@ declare class Ddu64Core {
|
|
|
471
555
|
/**
|
|
472
556
|
* 주어진 호출에 난독화를 적용해야 하는지 결정합니다.
|
|
473
557
|
* 호출별 옵션이 생성자 기본값을 오버라이드합니다.
|
|
474
|
-
*
|
|
558
|
+
* 6.0: 난독화는 암호화와 무관하게 적용됩니다(키 비의존). 키 없이도 난독화가 동작합니다.
|
|
475
559
|
*/
|
|
476
560
|
private shouldObfuscate;
|
|
477
561
|
private assertSafeChunkSeparator;
|
|
@@ -483,6 +567,13 @@ declare class Ddu64Core {
|
|
|
483
567
|
*
|
|
484
568
|
* @module core/CharsetBuilder
|
|
485
569
|
*
|
|
570
|
+
* @remarks
|
|
571
|
+
* non-BMP 주의: `fromUnicodeRange`/`addUnicodeRange`는 `String.fromCodePoint`로 U+FFFF를
|
|
572
|
+
* 넘는 문자(서로게이트 쌍, `.length === 2`)도 만들 수 있습니다. 그러나 `Ddu64` 생성자에
|
|
573
|
+
* 넘길 charset은 **BMP 단일 UTF-16 코드 유닛** 심볼만 허용하므로, non-BMP를 포함한 `build()`
|
|
574
|
+
* 결과를 charset으로 넘기면 코어가 "Multi-character symbols are not supported"로 거부합니다.
|
|
575
|
+
* 코어 charset 용도라면 BMP(≤ U+FFFF) 범위만 사용하세요.
|
|
576
|
+
*
|
|
486
577
|
* @example
|
|
487
578
|
* const chars = CharsetBuilder
|
|
488
579
|
* .fromUnicodeRange(0x4E00, 0x4E3F)
|
|
@@ -565,6 +656,11 @@ declare class CharsetBuilder {
|
|
|
565
656
|
unique(): CharsetBuilder;
|
|
566
657
|
/**
|
|
567
658
|
* 문자셋을 무작위로 섞습니다.
|
|
659
|
+
*
|
|
660
|
+
* ⚠️ 보안 주의: `seed` 없이 호출하면 `Math.random`을 사용하므로 암호학적으로 안전하지
|
|
661
|
+
* 않습니다(예측 가능). charset 순서를 비밀로 취급해 보안 경계로 삼지 마세요. 기밀성이
|
|
662
|
+
* 필요하면 `encryptionKey`(AES-256-GCM)를 사용하세요. `seed`를 주면 결정론적(재현 가능)
|
|
663
|
+
* 셔플이 되며, 이 역시 비밀이 아니라 재현성 용도입니다.
|
|
568
664
|
*/
|
|
569
665
|
shuffle(seed?: number): CharsetBuilder;
|
|
570
666
|
/**
|
|
@@ -668,6 +764,9 @@ declare class Ddu64ChecksumError extends Ddu64Error {
|
|
|
668
764
|
declare class Ddu64CharsetError extends Ddu64Error {
|
|
669
765
|
constructor(message: string, cause?: unknown);
|
|
670
766
|
}
|
|
767
|
+
declare class Ddu64InvalidInputError extends Ddu64Error {
|
|
768
|
+
constructor(message: string, operation?: Ddu64Operation, cause?: unknown);
|
|
769
|
+
}
|
|
671
770
|
declare class Ddu64LimitError extends Ddu64Error {
|
|
672
771
|
constructor(message: string, operation: Ddu64Operation, cause?: unknown);
|
|
673
772
|
}
|
|
@@ -682,4 +781,4 @@ declare class Ddu64StreamError extends Ddu64Error {
|
|
|
682
781
|
}
|
|
683
782
|
declare function isDdu64Error(error: unknown): error is Ddu64Error;
|
|
684
783
|
|
|
685
|
-
export { type CharSetConfig as C, Ddu64Core as D, type EncodingProfile as E, type
|
|
784
|
+
export { type DduConstructorOptions as A, type DduOptions as B, type CharSetConfig as C, Ddu64Core as D, type EncodingProfile as E, type DduSecureConstructorOptions as F, type DduSecureOptions as G, type DduStreamOptions as H, type KeyDerivationOptions as I, type KeyDerivationAlgorithm as K, type ObfuscationLayer as O, type PlatformAdapter as P, type DduBaseConstructorOptions as a, type DduBaseOptions as b, type DduEncodeStats as c, type CharSetInfo as d, CharsetBuilder as e, Ddu64AdapterError as f, Ddu64CharsetError as g, Ddu64ChecksumError as h, Ddu64CompressionError as i, Ddu64DecodeError as j, Ddu64DecompressionError as k, Ddu64DecryptionError as l, Ddu64EncodeError as m, Ddu64EncryptionError as n, Ddu64Error as o, Ddu64ErrorCode as p, type Ddu64ErrorOptions as q, Ddu64InvalidInputError as r, Ddu64LimitError as s, Ddu64ObfuscationError as t, type Ddu64Operation as u, Ddu64StreamError as v, type DduProgressInfo as w, DduSetSymbol as x, type DduSetSymbolInput as y, isDdu64Error as z };
|
package/dist/core.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=core.cjs.map
|
|
1
|
+
'use strict';var chunkJBUTKSCC_cjs=require('./chunk-JBUTKSCC.cjs'),chunkZTGECGM2_cjs=require('./chunk-ZTGECGM2.cjs');require('./chunk-BCUBYE76.cjs');Object.defineProperty(exports,"CharsetBuilder",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.j}});Object.defineProperty(exports,"Ddu64",{enumerable:true,get:function(){return chunkJBUTKSCC_cjs.i}});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,"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}});
|
package/dist/core.d.cts
CHANGED
|
@@ -1,40 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { C as CharSetConfig, b as CharSetInfo, c as CharsetBuilder, D as Ddu64, d as Ddu64AdapterError, e as Ddu64CharsetError, f as Ddu64ChecksumError, g as Ddu64CompressionError, D as Ddu64Core, h as Ddu64DecodeError, i as Ddu64DecompressionError, j as Ddu64DecryptionError, k as Ddu64EncodeError, l as Ddu64EncryptionError, m as Ddu64Error, n as Ddu64ErrorCode, o as Ddu64ErrorOptions, p as Ddu64LimitError, q as Ddu64ObfuscationError, r as Ddu64Operation, s as Ddu64StreamError, a as DduConstructorOptions, t as DduEncodeStats, u as DduOptions, v as DduProgressInfo, w as DduSetSymbol, x as DduTextEncoding, E as EncodingProfile, K as KeyDerivationAlgorithm, y as KeyDerivationOptions, O as ObfuscationLayer, P as PlatformAdapter, z as isDdu64Error } from './errors-DxOlTuHc.cjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ddunigma 비트 패킹 가속을 위한 WASM 로더 및 통합.
|
|
6
|
-
*
|
|
7
|
-
* 순수 JavaScript 구현과 바이트 단위로 동일한 선택적 WASM 가속
|
|
8
|
-
* 인코딩/디코딩을 제공합니다. WASM을 사용할 수 없거나 실패하면
|
|
9
|
-
* 조용히 JS로 폴백합니다.
|
|
10
|
-
*
|
|
11
|
-
* @module wasm/WasmCodec
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* WASM 모듈을 사전 로드하고 초기화합니다.
|
|
16
|
-
*
|
|
17
|
-
* 첫 번째 인코딩/디코딩 연산 전에 WASM이 준비되도록 애플리케이션 초기에
|
|
18
|
-
* 호출하세요. WASM이 초기화되면 resolve되고, 10초 내에 초기화에 실패하면
|
|
19
|
-
* reject됩니다.
|
|
20
|
-
*
|
|
21
|
-
* @throws WASM 초기화가 실패하거나 타임아웃(10초)된 경우 에러
|
|
22
|
-
*/
|
|
23
|
-
declare function preloadWasm(): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* WASM 코덱이 준비되었으면 반환하거나, 온디맨드 초기화를 시도합니다.
|
|
26
|
-
*
|
|
27
|
-
* `preloadWasm()`이 호출되지 않았으면 5초 타임아웃으로 초기화를 시도합니다.
|
|
28
|
-
* WASM을 사용할 수 없으면 null을 반환합니다.
|
|
29
|
-
*
|
|
30
|
-
* 이 함수는 throw하지 않음 — 실패 시 null을 반환합니다.
|
|
31
|
-
*/
|
|
32
|
-
declare function getWasmCodec(): WasmCodec | null;
|
|
33
|
-
/**
|
|
34
|
-
* WASM 코덱이 이미 초기화된 경우에만 반환합니다.
|
|
35
|
-
* 온디맨드 초기화를 트리거하지 않습니다.
|
|
36
|
-
* WASM이 준비되지 않았으면 null을 반환합니다.
|
|
37
|
-
*/
|
|
38
|
-
declare function getWasmCodecSync(): WasmCodec | null;
|
|
39
|
-
|
|
40
|
-
export { WasmCodec, getWasmCodec, getWasmCodecSync, preloadWasm };
|
|
1
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, D as Ddu64, 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 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, I as KeyDerivationOptions, O as ObfuscationLayer, P as PlatformAdapter, z as isDdu64Error } from './core-BsIwjJK-.cjs';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,40 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { C as CharSetConfig, b as CharSetInfo, c as CharsetBuilder, D as Ddu64, d as Ddu64AdapterError, e as Ddu64CharsetError, f as Ddu64ChecksumError, g as Ddu64CompressionError, D as Ddu64Core, h as Ddu64DecodeError, i as Ddu64DecompressionError, j as Ddu64DecryptionError, k as Ddu64EncodeError, l as Ddu64EncryptionError, m as Ddu64Error, n as Ddu64ErrorCode, o as Ddu64ErrorOptions, p as Ddu64LimitError, q as Ddu64ObfuscationError, r as Ddu64Operation, s as Ddu64StreamError, a as DduConstructorOptions, t as DduEncodeStats, u as DduOptions, v as DduProgressInfo, w as DduSetSymbol, x as DduTextEncoding, E as EncodingProfile, K as KeyDerivationAlgorithm, y as KeyDerivationOptions, O as ObfuscationLayer, P as PlatformAdapter, z as isDdu64Error } from './errors-DxOlTuHc.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ddunigma 비트 패킹 가속을 위한 WASM 로더 및 통합.
|
|
6
|
-
*
|
|
7
|
-
* 순수 JavaScript 구현과 바이트 단위로 동일한 선택적 WASM 가속
|
|
8
|
-
* 인코딩/디코딩을 제공합니다. WASM을 사용할 수 없거나 실패하면
|
|
9
|
-
* 조용히 JS로 폴백합니다.
|
|
10
|
-
*
|
|
11
|
-
* @module wasm/WasmCodec
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* WASM 모듈을 사전 로드하고 초기화합니다.
|
|
16
|
-
*
|
|
17
|
-
* 첫 번째 인코딩/디코딩 연산 전에 WASM이 준비되도록 애플리케이션 초기에
|
|
18
|
-
* 호출하세요. WASM이 초기화되면 resolve되고, 10초 내에 초기화에 실패하면
|
|
19
|
-
* reject됩니다.
|
|
20
|
-
*
|
|
21
|
-
* @throws WASM 초기화가 실패하거나 타임아웃(10초)된 경우 에러
|
|
22
|
-
*/
|
|
23
|
-
declare function preloadWasm(): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* WASM 코덱이 준비되었으면 반환하거나, 온디맨드 초기화를 시도합니다.
|
|
26
|
-
*
|
|
27
|
-
* `preloadWasm()`이 호출되지 않았으면 5초 타임아웃으로 초기화를 시도합니다.
|
|
28
|
-
* WASM을 사용할 수 없으면 null을 반환합니다.
|
|
29
|
-
*
|
|
30
|
-
* 이 함수는 throw하지 않음 — 실패 시 null을 반환합니다.
|
|
31
|
-
*/
|
|
32
|
-
declare function getWasmCodec(): WasmCodec | null;
|
|
33
|
-
/**
|
|
34
|
-
* WASM 코덱이 이미 초기화된 경우에만 반환합니다.
|
|
35
|
-
* 온디맨드 초기화를 트리거하지 않습니다.
|
|
36
|
-
* WASM이 준비되지 않았으면 null을 반환합니다.
|
|
37
|
-
*/
|
|
38
|
-
declare function getWasmCodecSync(): WasmCodec | null;
|
|
39
|
-
|
|
40
|
-
export { WasmCodec, getWasmCodec, getWasmCodecSync, preloadWasm };
|
|
1
|
+
export { C as CharSetConfig, d as CharSetInfo, e as CharsetBuilder, D as Ddu64, 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 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, I as KeyDerivationOptions, O as ObfuscationLayer, P as PlatformAdapter, z as isDdu64Error } from './core-BsIwjJK-.js';
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export{
|
|
2
|
-
//# sourceMappingURL=core.js.map
|
|
1
|
+
export{j as CharsetBuilder,i as Ddu64,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'./chunk-EI7MMDWY.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var chunkBDP7E7K3_cjs=require('./chunk-BDP7E7K3.cjs'),chunkJBUTKSCC_cjs=require('./chunk-JBUTKSCC.cjs'),chunkZTGECGM2_cjs=require('./chunk-ZTGECGM2.cjs'),chunkBCUBYE76_cjs=require('./chunk-BCUBYE76.cjs');var s=class extends chunkJBUTKSCC_cjs.i{static{chunkBCUBYE76_cjs.a(this,"Ddu64Node");}constructor(r,e,o){let t=chunkJBUTKSCC_cjs.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 chunkBDP7E7K3_cjs.a(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)}};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,"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.Ddu64=s;exports.Ddu64Node=s;
|