mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-07 00:03:07 +00:00
3 lines
2.8 MiB
JavaScript
3 lines
2.8 MiB
JavaScript
|
|
/*! For license information please see 2.a79c93db.chunk.js.LICENSE.txt */
|
||
|
|
(this["webpackJsonpeth-pm"]=this["webpackJsonpeth-pm"]||[]).push([[2],[function(e,t,r){e.exports=r(582)},function(e,t,r){"use strict";e.exports=r(574)},function(e,t,r){"use strict";r.r(t),r.d(t,"isBytesLike",(function(){return a})),r.d(t,"isBytes",(function(){return s})),r.d(t,"arrayify",(function(){return u})),r.d(t,"concat",(function(){return c})),r.d(t,"stripZeros",(function(){return f})),r.d(t,"zeroPad",(function(){return l})),r.d(t,"isHexString",(function(){return h})),r.d(t,"hexlify",(function(){return p})),r.d(t,"hexDataLength",(function(){return v})),r.d(t,"hexDataSlice",(function(){return y})),r.d(t,"hexConcat",(function(){return b})),r.d(t,"hexValue",(function(){return g})),r.d(t,"hexStripZeros",(function(){return m})),r.d(t,"hexZeroPad",(function(){return w})),r.d(t,"splitSignature",(function(){return k})),r.d(t,"joinSignature",(function(){return S}));var n=new(r(4).Logger)("bytes/5.3.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return h(e)&&!(e.length%2)||s(e)}function s(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(null==e.length)return!1;for(var t=0;t<e.length;t++){var r=e[t];if("number"!==typeof r||r<0||r>=256||r%1)return!1}return!0}function u(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid arrayify value");for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),o(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),h(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0x0"+a.substring(2):"right"===t.hexPad?a+="0":n.throwArgumentError("hex data is odd-length","value",e));for(var u=[],c=0;c<a.length;c+=2)u.push(parseInt(a.substring(c,c+2),16));return o(new Uint8Array(u))}return s(e)?o(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function c(e){var t=e.map((function(e){return u(e)})),r=t.reduce((function(e,t){return e+t.length}),0),n=new Uint8Array(r);return t.reduce((function(e,t){return n.set(t,e),e+t.length}),0),o(n)}function f(e){var t=u(e);if(0===t.length)return t;for(var r=0;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function l(e,t){(e=u(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}function h(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var d="0123456789abcdef";function p(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid hexlify value");for(var r="";e;)r=d[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){for(var o="0x",a=0;a<e.length;a++){var u=e[a];o+=d[(240&u)>>4]+d[15&u]}return o}return n.throwArgumentError("invalid hexlify value","value",e)}function v(e){if("string"!==typeof e)e=p(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function y(e,t,r){return"string"!==typeof e?e=p(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function b(e){var t="0x";return e.forEach((function(e){t+=p(e).substring(2)})),t}function g(e){var t=m(p(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function m(e){"string"!==typeof e&&(e=p(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function w(e,t){for("string"!==typeof e?e=p(e):h(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgum
|
||
|
|
//# sourceMappingURL=2.a79c93db.chunk.js.map
|