@ddunigma/node
Version:
1 lines • 2.45 kB
JavaScript
export{a as detectRuntime}from'./chunk-DVOLAE33.js';export{a as CharsetBuilder}from'./chunk-IZSFO3ET.js';import {a as a$1}from'./chunk-5VZELPTG.js';export{a as HangulObfuscationLayer,b as createEncoderObfuscationLayer}from'./chunk-5VZELPTG.js';import {i,b}from'./chunk-TCRCZHZC.js';export{i as Ddu64Core,a as DduSetSymbol}from'./chunk-TCRCZHZC.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}from'./chunk-EI7MMDWY.js';var s=class extends i{static{a(this,"Ddu64Node");}#d;#e;#u;#t;#r;constructor(r,e,t){let o=b(r,e,t),n={...o.dduOptions,...o.dduChar!==void 0?{dduChar:o.dduChar}:{},...o.paddingChar!==void 0?{paddingChar:o.paddingChar}:{},obfuscationLayerFactory:o.dduOptions?.obfuscationLayerFactory??(p=>new a$1(p))};super(n),this.#d=n,this.#u=n.compress===true,this.#t=n.encryptionKey!==void 0,this.#r=n.adapter!==void 0;}encode(r,e){return this.#s("encode",e),super.encode(r,e)}decodeToUint8Array(r,e){return this.#s("decode",e),super.decodeToUint8Array(r,e)}async encodeAsync(r,e){return this.#i(e)?(await this.#o()).encodeAsync(r,e):super.encodeAsync(r,e)}async decodeToUint8ArrayAsync(r,e){return this.#i(e)?(await this.#o()).decodeToUint8ArrayAsync(r,e):super.decodeToUint8ArrayAsync(r,e)}getStats(r,e){return this.#s("encode",e,false),super.getStats(r,e)}getStatsAsync(r,e){return !this.#r&&this.#n(e)?this.#o().then(t=>t.getStatsAsync(r,e)):super.getStatsAsync(r,e)}decodeToBuffer(r,e){let t=this.decodeToUint8Array(r,e);return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}async decodeToBufferAsync(r,e){let t=await this.decodeToUint8ArrayAsync(r,e);return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}#o(){return this.#e||(this.#e=import('./Ddu64Secure-CRWKMJLL.js').then(({Ddu64Secure:r})=>new r(this.#d))),this.#e}#i(r){return this.#r?false:this.#n(r)||this.#t}#n(r){return (r?.compress??this.#u)===true}#s(r,e,t=true){if(!this.#r&&(this.#n(e)||t&&this.#t))throw new m("@ddunigma/node: use encodeAsync/decodeAsync/getStatsAsync, or @ddunigma/node/secure for sync secure options.",r)}};export{s as Ddu64,s as Ddu64Node};