UNPKG

javascript-binary-converter

Version:

A utility package to quickly handle and convert various Javascript binary objects

1 lines 22.5 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["javascript-binary-converter"]=e():t["javascript-binary-converter"]=e()}(this,(()=>(()=>{"use strict";var __webpack_modules__={790:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(961)),o=n(r(455)),a=n(r(274)),s=n(r(862)),u=r(340),l=n(r(46)),c=n(r(791)),g=n(r(553)),y=n(r(142)),f=n(r(270));e.default=function(t){if(u.isNode&&"Blob"===t.constructor.name)throw new Error("In order to convert a Blob in Node, import BlobConverter directly");if(t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint32Array)return new o.default(t);if(!u.isNode){if(t instanceof File)return new a.default(t);if(t instanceof HTMLImageElement)return new l.default(t);if(t instanceof Blob)return new i.default(t)}if("string"==typeof t)return new f.default(t);if(t instanceof ArrayBuffer)return new s.default(t);if("number"==typeof t||"bigint"==typeof t)return new y.default(t);if(Array.isArray(t)&&"number"==typeof t[0])return new g.default(t);if(Array.isArray(t)&&"string"==typeof t[0])return new c.default(t);throw new Error("The argument supplied is not a convertible")}},862:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(73),i=r(340),o=r(524);e.default=class{constructor(t){this.original=t}async toImage({type:t="image/jpeg",maxSize:e}={}){const r=new Uint8Array(this.original),n=new Blob([r],{type:t});return e?await(0,o.binaryToImage)(n,{maxSize:e}):await(0,o.binaryToImage)(n)}async toBlob(t){return new(await(0,i.getBlobClass)())([this.toUint8Array()],t)}toUint8Array(){return new Uint8Array(this.original)}toInt8Array(){return new Int8Array(this.original)}toUint16Array(){return new Uint16Array(this.original)}toInt16Array(){return new Int16Array(this.original)}toInt32Array(){return new Int32Array(this.original)}toUint32Array(){return new Uint32Array(this.original)}toBigUint64(){return new BigUint64Array(this.original)}toBigInt64(){return new BigInt64Array(this.original)}toBytes(){return(0,n.arrayBufferToBytes)(this.original)}toDecimalBytes({isSigned:t=!1}={}){return(0,n.arrayBufferToDecimalBytes)(this.original,{isSigned:t})}}},586:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseBytesConverter=void 0;const n=r(340),i=r(524);e.BaseBytesConverter=class{constructor(t){this.original=t}toText(){const t=this.toUint8Array();return(new TextDecoder).decode(t)}async toBlob(t){return new(await(0,n.getBlobClass)())([this.toUint8Array()],t)}async toImage(t){const e=new(await(0,n.getBlobClass)())([this.toUint8Array()]);return(0,i.binaryToImage)(e,t&&t)}}},102:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(73),i=r(802);e.default=class{constructor(t){this.original=t}toInteger({isSigned:t=!1}={}){return(0,n.binaryToInteger)(this.original,t)}toFloat({precision:t="SINGLE"}={}){return(0,n.binaryToFloat)(this.original,{precision:t})}toHexString(){return(0,i.binaryToHexString)(this.original)}}},961:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});const a=r(73),s=r(938),u=o(r(524));e.default=class{constructor(t){this.original=t}async toUint8Array(){const t=await this.toArrayBuffer();return new Uint8Array(t)}async toInt8Array(){const t=await this.toArrayBuffer();return new Int8Array(t)}async toArrayBuffer(){return await this.original.arrayBuffer()}async toImage(t){return u.binaryToImage(this.original,t||void 0)}async toCanvas(){return(0,s.blobToCanvas)(this.original)}async toBytes(){const t=await this.toUint8Array();return(0,a.typedArrayToBytes)(t)}async toDecimalBytes({isSigned:t=!1}={}){const e=await this.toArrayBuffer();return(0,a.arrayBufferToDecimalBytes)(e,{isSigned:t})}toBase64(t={appendDataUrl:!1}){return(0,s.blobToBase64)(this.original,t)}}},791:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(73),i=r(802),o=r(91),a=r(450),s=r(586);class u extends s.BaseBytesConverter{constructor(t){super(t),this.original=t,this.original=this.original.map((t=>(0,o.padString)(t)))}_getIntegers(t=!1){return this.original.map((e=>(0,n.binaryToInteger)(e,t)))}toUint8Array(){return new Uint8Array(this._getIntegers())}toInt8Array(){return new Int8Array(this._getIntegers(!0))}toUint16Array(){const t=this._getIntegers(!1);return new Uint16Array(new Uint8Array(t).buffer)}toInt16Array(){const t=this._getIntegers(!0);return new Int16Array(new Int8Array(t).buffer)}toUint32Array(){const t=this._getIntegers(!1);return new Uint32Array(new Uint8Array(t).buffer)}toInt32Array(){const t=this._getIntegers(!0);return new Int32Array(new Int8Array(t).buffer)}toBigInt64Array(){const t=this._getIntegers(!0);return new BigInt64Array(new Int8Array(t).buffer)}toBigUint64Array(){const t=this._getIntegers(!0);return new BigUint64Array(new Uint8Array(t).buffer)}toFloat32Array(){const t=this.toInt32Array();return new Float32Array(t.buffer)}toIntegers({isSigned:t=!1,integerSize:e=8}={}){let r;switch(e){case 8:return this.original.map((e=>(0,n.binaryToInteger)(e,t)));case 16:return r=t?this.toInt16Array():this.toUint16Array(),(0,a.typedArrayToIntegers)(r);case 32:return r=t?this.toInt32Array():this.toUint32Array(),(0,a.typedArrayToIntegers)(r);case 64:return r=t?this.toBigInt64Array():this.toBigUint64Array(),(0,a.typedArrayToIntegers)(r);default:throw new Error("The integer size is invalid(8,16,32,64 are allowed)")}}toHexString({isSigned:t=!1}={}){return this.original.map((e=>(0,i.integerToHexaDecimal)((0,n.binaryToInteger)(e,t))))}}e.default=u},553:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(802),i=r(586);class o extends i.BaseBytesConverter{constructor(t){super(t),this.original=t}toUint8Array(){return new Uint8Array(this.original)}toInt8Array(){return new Int8Array(this.original)}toUint16Array(){return new Uint16Array(this.toUint8Array().buffer)}toInt16Array(){const t=this.toInt8Array();return new Int16Array(t.buffer)}toUint32Array(){return new Uint32Array(this.toUint8Array().buffer)}toInt32Array(){return new Int32Array(this.toInt8Array().buffer)}toBigUint64Array(){return new BigUint64Array(this.toUint8Array().buffer)}toBigInt64Array(){return new BigInt64Array(this.toInt8Array().buffer)}toHexString(){return this.original.map((t=>(0,n.integerToHexaDecimal)(t)))}}e.default=o},274:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(340),o=r(524),a=n(r(961));class s extends a.default{constructor(t){if(super(t),i.isNode)throw new Error("FileConvertor is available only in the browser")}async toImage(t){if(!1!==t?.validateImage&&!this.original.type.match(/image.*/))throw new Error("File supplied is not an image");return(0,o.binaryToImage)(this.original,t||void 0)}}e.default=s},262:function(t,e,r){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=r(802),o=n(r(142));e.default=class{constructor(t){this.original=t,this.numberConverter=new o.default(parseInt(t,16))}toBinary(){return this.numberConverter.toBinary()}toInteger({isSigned:t=!1}={}){return(0,i.hexStringToInteger)(this.original,{isSigned:t})}toFloat({precision:t="SINGLE"}={}){return(0,i.hexStringToFloat)(this.original,{precision:t})}}},46:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(73),i=r(340),o=r(524);e.default=class{constructor(t){if(this.original=t,i.isNode)throw new Error("ImageConvertor is available only in the browser")}async toBlob(t){return(0,o.imageToBlob)(this.original,{height:t?.height,width:t?.width})}async toArrayBuffer(t){return(await this.toBlob(t)).arrayBuffer()}async toUint8Array(){return new Uint8Array(await this.toArrayBuffer())}async toInt8Array(){return new Int8Array(await this.toArrayBuffer())}async toBytes(){const t=await this.toUint8Array();return(0,n.typedArrayToBytes)(t)}async toDecimalBytes(){const t=await this.toBytes();return(0,n.bytesToIntegers)(t)}toCanvas(t){const e=t?.width||this.original.width,r=t?.height||this.original.height;return(0,o.imageToCanvas)(this.original,{width:e,height:r})}}},142:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(73),i=r(802),o=r(228);e.default=class{constructor(t){this.original=t}toBinary({precision:t="SINGLE"}={}){return(0,o.isBigInt)(this.original)?(0,n.bigIntegerToBinary)(this.original):(0,o.isFloat)(this.original)?(0,n.floatToBinary)(this.original,{precision:t}):(0,n.integerToBinary)(this.original)}toInteger({isSigned:t=!1}={}){if(!t)return parseInt(this.original);const e=this.original.toString(16);return(0,i.hexStringToInteger)(e,{isSigned:t})}toBytes({endianness:t="BIG"}={}){return(0,n.getBytesFromInteger)(this.original,{endianness:t})}toDecimalBytes({endianness:t="BIG",isSigned:e=!1}={}){return(0,n.getDecimalBytesFromInteger)(this.original,{endianness:t,isSigned:e})}toHexString({precision:t="SINGLE"}={}){return"number"==typeof this.original?(0,o.isFloat)(this.original)?(0,i.floatToHexString)(this.original,{precision:t}):(0,i.integerToHexaDecimal)(this.original):(0,i.bigIntegerToHexaDecimal)(this.original)}toFloat({precision:t="SINGLE"}={}){return(0,i.hexStringToFloat)(this.original.toString(16),{precision:t})}}},270:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(91);e.default=class{constructor(t){this.original=t}toBinary(){return(0,n.stringToBinary)(this.original)}toUint8Array(){return(new TextEncoder).encode(this.original)}}},455:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const n=r(73),i=r(340),o=r(524);e.default=class{constructor(t){this.original=t}toUint8Array(){return new Uint8Array(this.original.buffer)}toInt8Array(){return new Int8Array(this.original.buffer)}toInt16Array(){return new Int16Array(this.original.buffer)}toUint16Array(){return new Uint16Array(this.original.buffer)}toInt32Array(){return new Int32Array(this.original.buffer)}toUint32Array(){return new Uint32Array(this.original.buffer)}toBigUint64Array(){return new BigUint64Array(this.original.buffer)}toBigInt64Array(){return new BigInt64Array(this.original.buffer)}toFloat32(){return new Float32Array(this.original.buffer)}toText(){return(new TextDecoder).decode(this.original)}async toBlob(t){return new(await(0,i.getBlobClass)())([this.original],t)}async toImage(t){return(0,o.binaryToImage)(await this.toBlob(),t&&t)}toBytes(){return this.original instanceof Uint8Array?(0,n.typedArrayToBytes)(this.original):(0,n.typedArrayToBytes)(new Uint8Array(this.original))}toDecimalBytes(){const t=this.toBytes();return(0,n.bytesToIntegers)(t)}}},432:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.HexStringConverter=e.BinaryConverter=e.NumberConverter=e.DecimalBytesConverter=e.BytesConverter=e.ArrayBufferConverter=e.ImageConverter=e.FileConverter=e.TypedArrayConverter=e.BlobConverter=e.converter=void 0;const s=a(r(790));e.converter=s.default;const u=a(r(961));e.BlobConverter=u.default;const l=a(r(455));e.TypedArrayConverter=l.default;const c=a(r(274));e.FileConverter=c.default;const g=a(r(46));e.ImageConverter=g.default;const y=a(r(862));e.ArrayBufferConverter=y.default;const f=a(r(791));e.BytesConverter=f.default;const d=a(r(553));e.DecimalBytesConverter=d.default;const h=a(r(142));e.NumberConverter=h.default;const p=a(r(102));e.BinaryConverter=p.default;const b=a(r(262));e.HexStringConverter=b.default;const w=o(r(506));e.utils=w,e.default=s.default},73:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.arrayBufferToDecimalBytes=e.bytesToIntegers=e.arrayBufferToBytes=e.getDecimalBytesFromInteger=e.getBytesFromInteger=e.groupBytes=e.typedArrayToBytes=e.getDecimalFromTwosComplementBinary=e.getSignedInteger=e.binaryToInteger=e.getBytesFromBinary=e.bigIntegerToBinary=e.binaryToFloat=e.floatToBinary=e.integerToBinary=void 0;const n=r(7),i=r(340),o=r(228),a=r(91);function s(t){return(t>>>0).toString(2)}function u(t,{precision:e="SINGLE"}={}){const r="SINGLE"===e?new Float32Array([t]):new Float64Array([t]),n=d(new Uint8Array(r.buffer));return"LITTLE"===(0,i.getSystemEndianness)()?n.reverse().join(""):n.join("")}function l(t,e=BigInt(64)){return(0,o.normalizeBigInt)(t,e).toString(2)}function c(t,{endianness:e="LITTLE"}={}){if(t.length<=7)return[(0,a.padString)(t)];let r=(0,o.getClosestDividable)(t.length,8);const i=(0,a.padString)(t,r);let s=(0,n.splitBinaryStringToBytes)(i);return"LITTLE"===e?s.reverse():s}function g(t,e=!1){if(t.length>32)throw new Error("binaryToInteger does not support bigint");return e?y(t):parseInt(t,2)}function y(t){return"1"===t[0]?f(t):parseInt(t,2)}function f(t){const e=(0,n.getTwosComplementBinary)(t);return-1*parseInt(e,2)}function d(t){const e=[];for(let r of t){const t=s(r);e.push((0,a.padString)(t,8))}return e}function h(t,{endianness:e="BIG"}={}){return"number"==typeof t&&(0,o.isFloat)(t)?c(u(t)):c((0,o.isBigInt)(t)?l(t):s(t),{endianness:e})}e.integerToBinary=s,e.floatToBinary=u,e.binaryToFloat=function(t,{precision:e="SINGLE"}={}){const r="SINGLE"===e?32:64,i=r/8;t=(0,a.padString)(t,r);const o=(0,n.splitBinaryStringToBytes)(t);var s=new ArrayBuffer(i),u=new Uint8Array(s);for(let t=0;t<o.length;t++)u[t]=g(o[t]);var l=new DataView(s);return"SINGLE"===e?l.getFloat32(0,!1):l.getFloat64(0,!1)},e.bigIntegerToBinary=l,e.getBytesFromBinary=c,e.binaryToInteger=g,e.getSignedInteger=y,e.getDecimalFromTwosComplementBinary=f,e.typedArrayToBytes=d,e.groupBytes=function(t,e){const r=[];let n="";for(let i=1;i<=t.length;i++)n+=t[i-1],i%e==0&&(r.push(n),n="");return r},e.getBytesFromInteger=h,e.getDecimalBytesFromInteger=function(t,{endianness:e="BIG",isSigned:r=!1}={}){return h(t,{endianness:e}).map((t=>g(t,r)))},e.arrayBufferToBytes=function(t){return d(new Uint8Array(t))},e.bytesToIntegers=function(t){return t.map((t=>g(t)))},e.arrayBufferToDecimalBytes=function(t,{isSigned:e=!1}={}){const r=e?new Int8Array(t):new Uint8Array(t);return Array.from(r)}},7:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.splitBinaryStringToBytes=e.getInverseBinary=e.getTwosComplementBinary=void 0;const n=r(91);function i(t){let e="";for(let r=0;r<t.length;r++)e+="0"===t[r]?"1":"0";return e}e.getTwosComplementBinary=function(t){const e=i(t);return(parseInt(e,2)+1).toString(2)},e.getInverseBinary=i,e.splitBinaryStringToBytes=function(t){return(0,n.splitStringToChunks)(t,8)}},938:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.blobToCanvas=e.blobToBase64=void 0;const n=r(340);e.blobToBase64=function(t,e={appendDataUrl:!1}){return n.isNode?async function(t){const e=await t.arrayBuffer(),r=new Uint8Array(e);return Buffer.from(r).toString("base64")}(t):new Promise((r=>{const n=new FileReader;n.readAsDataURL(t),n.onloadend=()=>{const t=n.result;r(e?.appendDataUrl?t:t.split(",")[1])}}))},e.blobToCanvas=async function(t){var e=document.createElement("canvas"),r=e.getContext("2d"),n=new Image;return n.src=URL.createObjectURL(t),await new Promise((t=>n.onload=t)),e.height=n.height,e.width=n.width,r.drawImage(n,0,0,n.width,n.height),e}},340:(__unused_webpack_module,exports)=>{async function getBlobClass(){if(await Promise.resolve(),exports.isNode){let prom=eval("import('node:buffer')");const{Blob:BlobClass}=await prom;return BlobClass}return Blob}function getSystemEndianness(){const t=new Uint16Array([256]);return 1===new Uint8Array(t.buffer)[0]?"BIG":"LITTLE"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSystemEndianness=exports.getBlobClass=exports.isNode=void 0,exports.isNode="undefined"==typeof window,exports.getBlobClass=getBlobClass,exports.getSystemEndianness=getSystemEndianness},802:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.splitHexStringToHexBytes=e.hexStringToFloat=e.hexStringToInteger=e.binaryToHexString=e.hexStringToBinary=e.floatToHexString=e.bigIntegerToHexaDecimal=e.integerToHexaDecimal=void 0;const n=r(73),i=r(228),o=r(91);function a(t){return parseInt(t,16).toString(2).toUpperCase()}function s(t){return(0,o.splitStringToChunks)(t,2)}e.integerToHexaDecimal=function(t){return(t>>>0).toString(16).toUpperCase()},e.bigIntegerToHexaDecimal=function(t){return(0,i.normalizeBigInt)(t).toString(16).toUpperCase()},e.floatToHexString=function(t,{precision:e="SINGLE"}={}){const r="SINGLE"===e?4:8,n=new DataView(new ArrayBuffer(r));return"SINGLE"===e?n.setFloat32(0,t):n.setFloat64(0,t),Array.apply(null,{length:r}).map(((t,e)=>(t=>("00"+t.toString(16)).slice(-2))(n.getUint8(e)))).join("").toLocaleUpperCase()},e.hexStringToBinary=a,e.binaryToHexString=function(t,{isSigned:e=!1}={}){return parseInt(t,2).toString(16).toUpperCase()},e.hexStringToInteger=function(t,{isSigned:e=!1}={}){if(e){const e=a(t);return(0,n.getDecimalFromTwosComplementBinary)(e)}return parseInt(t,16)},e.hexStringToFloat=function(t,{precision:e="SINGLE"}={}){const r=("SINGLE"===e?32:64)/8,n=s(t=function(t,e){return"x"!==t[1]&&"X"!==t[1]||(t=t.slice(2)),(0,o.padString)(t,e,"0")}(t,2*r));var i=new ArrayBuffer(r),a=new Uint8Array(i);for(let t=0;t<n.length;t++)a[t]=parseInt(n[t],16);var u=new DataView(i);return"SINGLE"===e?u.getFloat32(0,!1):u.getFloat64(0,!1)},e.splitHexStringToHexBytes=s},524:(t,e)=>{async function r(t,e){const r=new Image;r.src=URL.createObjectURL(t),await new Promise((t=>r.onload=t));const o=n({width:r.width,height:r.height,maxSize:e.maxSize});return await i(r,o)}function n({width:t,height:e,maxSize:r}){let n=t,i=e;return n>i?n>r&&(i*=r/n,n=r):i>r&&(n*=r/i,i=r),{width:n,height:i}}async function i(t,e){const r=e?.height||t.height,n=e?.width||t.width,i=e?.type||"image/png",a=o(t,{height:r,width:n});return await new Promise((t=>a.toBlob(t,i)))}function o(t,e){const r=document.createElement("canvas");return r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(t,0,0,e.width,e.height),r}Object.defineProperty(e,"__esModule",{value:!0}),e.imageToCanvas=e.imageToBlob=e.getScaledDimensions=e.getBlobWithModifiedImageSize=e.binaryToImage=void 0,e.binaryToImage=async function(t,e){let n;n=e?.maxSize?await r(t,{maxSize:e.maxSize}):t;const i=new Image;return i.src=URL.createObjectURL(n),await new Promise((t=>i.onload=t)),i},e.getBlobWithModifiedImageSize=r,e.getScaledDimensions=n,e.imageToBlob=i,e.imageToCanvas=o},506:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.string=e.crossPlatform=e.number=e.hex=e.blob=e.image=e.binary=void 0;const a=o(r(73));e.binary=a;const s=o(r(524));e.image=s;const u=o(r(938));e.blob=u;const l=o(r(228));e.number=l;const c=o(r(340));e.crossPlatform=c;const g=o(r(91));e.string=g;const y=o(r(802));e.hex=y},228:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeBigInt=e.getClosestDividable=e.isBigInt=e.isFloat=e.isNumeric=void 0,e.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},e.isFloat=function(t){return"number"==typeof t&&!Number.isInteger(t)},e.isBigInt=function(t){return"bigint"==typeof t||t>4294967295||t<-2147483647},e.getClosestDividable=function(t,e){let r=t%e;for(;0!==r;)r=++t%e;return t},e.normalizeBigInt=function(t,e=BigInt(64)){return[t,e]=[BigInt(t),BigInt(e)],t>=0?t:BigInt(BigInt(2)**e)+t}},91:(t,e)=>{function r(t,e=8,r="0"){let n=t;const i=e-t.length;for(let t=0;t<i;t++)n=r+n;return n}Object.defineProperty(e,"__esModule",{value:!0}),e.stringToBinary=e.splitStringToChunks=e.isNumericString=e.reverseString=e.trimString=e.padString=void 0,e.padString=r,e.trimString=function(t,e=8){return t.slice(t.length-e)},e.reverseString=function(t){return t.split("").reverse().join("")},e.isNumericString=function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&"string"==typeof t},e.splitStringToChunks=function(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))},e.stringToBinary=function(t){const e=(new TextEncoder).encode(t);let n="";for(let t of e)n+=r(t.toString(2));return n}},450:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.typedArrayToIntegers=void 0,e.typedArrayToIntegers=function(t){const e=[];for(let r of t)e.push(r);return e}}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__webpack_require__),r.exports}var __webpack_exports__=__webpack_require__(432);return __webpack_exports__})()));