faucet-server 0.0.7 → 0.1.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.
@@ -1 +0,0 @@
1
- var e=BigInt(2**32-1),t=BigInt(32);function n(n,r=!1){return r?{h:Number(n&e),l:Number(n>>t&e)}:{h:Number(n>>t&e)|0,l:Number(n&e)|0}}function r(e,t=!1){let r=e.length,i=new Uint32Array(r),a=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=n(e[o],t);[i[o],a[o]]=[r,s]}return[i,a]}var i=(e,t,n)=>e<<n|t>>>32-n,a=(e,t,n)=>t<<n|e>>>32-n,o=(e,t,n)=>t<<n-32|e>>>64-n,s=(e,t,n)=>e<<n-32|t>>>64-n,c=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0;function l(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function u(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function d(e,...t){if(!l(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function f(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);u(e.outputLen),u(e.blockLen)}function p(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function m(e,t){d(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function h(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function g(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function _(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function v(e,t){return e<<32-t|e>>>t}var y=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function b(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function x(e){for(let t=0;t<e.length;t++)e[t]=b(e[t]);return e}var S=y?e=>e:x;typeof Uint8Array.from([]).toHex==`function`&&Uint8Array.fromHex;function C(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function w(e){return typeof e==`string`&&(e=C(e)),d(e),e}function T(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];d(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}var E=class{};function D(e){let t=t=>e().update(w(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ee(e){let t=(t,n)=>e(n).update(w(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function te(e=32){if(c&&typeof c.getRandomValues==`function`)return c.getRandomValues(new Uint8Array(e));if(c&&typeof c.randomBytes==`function`)return Uint8Array.from(c.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}var O=BigInt(0),k=BigInt(1);function A(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function j(e){if(!A(e))throw Error(`Uint8Array expected`)}function M(e,t){if(typeof t!=`boolean`)throw Error(e+` boolean expected, got `+t)}function N(e){let t=e.toString(16);return t.length&1?`0`+t:t}function P(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?O:BigInt(`0x`+e)}var F=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,I=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function L(e){if(j(e),F)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=I[e[n]];return t}var R={_0:48,_9:57,A:65,F:70,a:97,f:102};function z(e){if(e>=R._0&&e<=R._9)return e-R._0;if(e>=R.A&&e<=R.F)return e-(R.A-10);if(e>=R.a&&e<=R.f)return e-(R.a-10)}function B(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(F)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=z(e.charCodeAt(i)),a=z(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function V(e){return P(L(e))}function H(e){return j(e),P(L(Uint8Array.from(e).reverse()))}function U(e,t){return B(e.toString(16).padStart(t*2,`0`))}function W(e,t){return U(e,t).reverse()}function G(e,t,n){let r;if(typeof t==`string`)try{r=B(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(A(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}function K(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];j(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function q(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}var J=e=>typeof e==`bigint`&&O<=e;function Y(e,t,n){return J(e)&&J(t)&&J(n)&&t<=e&&e<n}function X(e,t,n,r){if(!Y(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function Z(e){let t;for(t=0;e>O;e>>=k,t+=1);return t}var ne=e=>(k<<BigInt(e))-k,Q=e=>new Uint8Array(e),$=e=>Uint8Array.from(e);function re(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=Q(e),i=Q(e),a=0,o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),c=(e=Q(0))=>{i=s($([0]),e),r=s(),e.length!==0&&(i=s($([1]),e),r=s())},l=()=>{if(a++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){r=s();let t=r.slice();n.push(t),e+=r.length}return K(...n)};return(e,t)=>{o(),c(e);let n;for(;!(n=t(l()));)c();return o(),n}}var ie={bigint:e=>typeof e==`bigint`,function:e=>typeof e==`function`,boolean:e=>typeof e==`boolean`,string:e=>typeof e==`string`,stringOrUint8Array:e=>typeof e==`string`||A(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e==`function`&&Number.isSafeInteger(e.outputLen)};function ae(e,t,n={}){let r=(t,n,r)=>{let i=ie[n];if(typeof i!=`function`)throw Error(`invalid validator function`);let a=e[t];if(!(r&&a===void 0)&&!i(a,e))throw Error(`param `+String(t)+` is invalid. Expected `+n+`, got `+a)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e}function oe(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}export{_ as A,a as B,p as C,g as D,m as E,w as F,h as I,o as L,te as M,v as N,T as O,S as P,s as R,d as S,u as T,r as V,W as _,ne as a,ae as b,H as c,G as d,B as f,U as g,oe as h,Z as i,ee as j,D as k,K as l,A as m,M as n,L as o,Y as p,j as r,V as s,X as t,re as u,N as v,f as w,E as x,q as y,i as z};