@tktb-tess/util-fns 0.11.1 → 0.11.3
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/README.md +2 -0
- package/dist/bundle.js +374 -482
- package/dist/bundle.min.js +2 -2
- package/dist/pcg_minimal.d.ts +4 -6
- package/dist/random.d.ts +1 -23
- package/dist/util.d.ts +1 -6
- package/dist/worker_stream.d.ts +1 -1
- package/dist/xoshiro_minimal.d.ts +7 -8
- package/package.json +8 -7
- package/dist/icon.svg +0 -23
package/dist/bundle.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var UtilFns=(function(c){"use strict";const
|
|
2
|
-
`&&!s?(e.push(r.trim()),t.push(e),e=[],r=""):r+=o}return e.push(r.trim()),t.push(e),t},J=async(n,t)=>{const e=k.encode(n),r=await crypto.subtle.digest(t,e);return new Uint8Array(r)},Y=()=>!!globalThis.process&&typeof process.version<"u"&&typeof process.versions.node<"u",Z=n=>encodeURIComponent(n).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),x=n=>{if(n.includes("+"))throw Error("An input string has '+'");return decodeURIComponent(n)},Q=async(n,t)=>{const r=new Blob([n]).stream().pipeThrough(new CompressionStream(t));return new Response(r).bytes()},tt=async(n,t)=>{const r=new Blob([n]).stream().pipeThrough(new DecompressionStream(t));return new Response(r).bytes()},nt=(n,t)=>new Promise((e,r)=>{setTimeout(async()=>{try{const s=await n();e(s)}catch(s){r(s)}},t)}),N="NamedError";class p extends Error{constructor(t,e,r){super(e,r),this.errName=t}static name=N;toJSON(){const t=(()=>{const i=this.cause;return typeof i=="string"||typeof i=="number"||typeof i=="boolean"?i:typeof i=="bigint"?i.toString():typeof i=="object"&&i!==null?i instanceof Set||i instanceof Map?Object.fromEntries(i):i:void 0})(),{errName:e,message:r,stack:s}=this;return{errName:e,message:r,stack:s,cause:t}}}Object.defineProperty(p.prototype,Symbol.toStringTag,{value:N});const et=(n,t)=>Math.floor(Math.random()*(t-n)+n),m=(n,t)=>{t<0n&&(t*=-1n);const e=n%t;return e<0n?e+t:e},I=(n,t=!1)=>{if(!Number.isFinite(n))throw Error("`length` is not a valid number");if(n<=0)throw Error("`length` must be positive");const e=Math.ceil(n/8),r=crypto.getRandomValues(new Uint8Array(e));let s=Array.from(r,i=>i.toString(2).padStart(8,"0")).join("").slice(0,n);return t&&(s=s.replace(/^\d/,"1")),BigInt("0b"+s)},v=(n,t)=>{if(n>=t)throw new p("RangeError","min is larger than max");const e=t-n,r=e.toString(2).length,s=(()=>{for(let o=0;o<1e5;o++){const a=I(r);if(a>=y(2n,BigInt(r),e))return a%e}throw Error("Failed to generate a random bigint")})();return n+s},y=(n,t,e)=>{if(e<1n)throw Error("`mod` must be positive");if(t<0n)throw Error("`power` must not be negative");if(n=m(n,e),e===1n)return 0n;if(n%e===1n||n%e===0n)return n;if(n===e-1n)return t&1n?e-1n:1n;let r=1n;for(;t>0n;)t&1n&&(r=r*n%e),n=n*n%e,t>>=1n;return r},L=(n,t)=>{if(n===0n&&t===0n)return{x:0n,y:0n,gcd:0n};if(n===0n)return t>0n?{x:0n,y:-1n,gcd:t}:{x:0n,y:1n,gcd:-t};if(t===0n)return n>0n?{x:1n,y:0n,gcd:n}:{x:-1n,y:0n,gcd:-n};let[e,r,s]=[1n,0n,n],[i,o,a]=[0n,-1n,t];for(;;){const l=s/a,u=s-l*a;if(u===0n)break;[e,i]=[i,e-l*i],[r,o]=[o,r-l*o],[s,a]=[a,u]}return a<0n&&(i*=-1n,o*=-1n,a*=-1n),{x:i,y:o,gcd:a}},w=(n,t)=>{if(n>=t)return 1n;const e=BigInt((t-2n).toString(2).length),r=(t-n)/2n;if(e*r<63n){let a=n;for(let l=n+2n;l<t;l+=2n)a*=l;return a}const s=n+r|1n,i=w(n,s),o=w(s,t);return i*o},rt=n=>{let t=3n,e=1n,r=1n;const s=BigInt(n.toString(2).length)-1n;for(let i=s-1n;i>-1n;--i){const o=(n>>i)+1n|1n;r*=w(t,o),t=o,e*=r}return e},st=n=>{if(n<0n)throw Error("'n' must be non-negative");if(n===0n)return 1n;const t=n-BigInt(n.toString(2).match(/1/g)?.length??0);return rt(n)<<t},M=(n,t)=>(n>>>(t&31)|n<<(-t&31))>>>0,b=(n,t)=>BigInt.asUintN(64,n>>(t&63n)|n<<(-t&63n)),E=(n,t)=>{if(t<1n||t%2n===0n)throw Error("`n` is invalid");for(;n<0n;)n+=t;n%=t;let e=1n;for(;n!==0n;){for(;n%2n===0n;){n/=2n;const r=t%8n;(r===3n||r===5n)&&(e*=-1n)}[n,t]=[t,n],n%4n===3n&&t%4n===3n&&(e*=-1n),n%=t}return t===1n?e:0n},A=n=>{if(n<0n)return!1;if(n===0n)return!0;let t=1n,e=n;for(;t+1n<e;){const r=(t+e)/2n;r*r<n?t=r:e=r}return n===t**2n||n===(t+1n)**2n},it=n=>{if(n<=1n)return!1;if(n%2n===0n)return n===2n;let t=n-1n,e=0n;for(;t%2n===0n;)t>>=1n,e+=1n;const[r,s]=[t,e];let o=y(2n,r,n);if(o===1n)return!0;for(let a=0n;a<s;a++){if(o===n-1n)return!0;o=o*o%n}return!1},ot=n=>{let t=5n,e=E(t,n);for(;e>0n;){if(t=t>0n?t+2n:t-2n,t*=-1n,t===-15n&&A(n))return[0n,0n];e=E(t,n)}return[t,e]},B=(n,t)=>(n&1n)===1n?m(n+t>>1n,t):m(n>>1n,t),ct=(n,t,e,r)=>{let s=1n,i=e;const o=n.toString(2).slice(1);for(const a of o)[s,i]=[m(s*i,t),B(i*i+r*s*s,t)],a==="1"&&([s,i]=[B(e*s+i,t),B(r*s+e*i,t)]);return[s,i]},at=(n,t,e,r)=>{if(n%2n!==1n)throw Error("`n` must be odd");let s=n+1n,i=0n;for(;s%2n===0n;)s>>=1n,i+=1n;const[o,a]=ct(s,n,e,t);let l=a;if(o===0n)return!0;r=y(r,s,n);for(let u=0n;u<i;u++){if(l===0n)return!0;l=m(l*l-2n*r,n),r=y(r,2n,n)}return!1},S=n=>{if(n<=1n)return!1;if(n%2n===0n)return n===2n;const t=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n];for(const i of t)if(n%i===0n)return n===i;if(!it(n))return!1;const[e,r]=ot(n);if(r===0n)return!1;const s=(1n-e)/4n;return at(n,e,1n,s)},lt=(n,t)=>{if(t<2n)throw Error("NoPrimesFound");for(let r=0;r<1e5;r++){const s=v(n,t);if(S(s))return s}throw Error("NoPrimesFound")},ut=(n,t=!1)=>{if(n<2)throw Error("NoPrimesFound");for(let r=0;r<1e5;r++){const s=I(n,t);if(S(s))return s}throw Error("NoPrimesFound")},T="Rational";class f{#t;#n;static name=T;constructor(t,e){e===0n?(this.#n=0n,this.#t=t===0n?0n:t>0n?1n:-1n):e>0n?(this.#t=t,this.#n=e):(this.#t=-t,this.#n=-e),this.#e()}static fromDecimal(t,e=5){if(Number.isNaN(t))return new f(0n,0n);if(Math.abs(t)===1/0)return new f(t>0?1n:-1n,0n);const r=t<0;r&&(t*=-1);const s=BigInt(Math.floor(t)),i=t-Number(s);if(i===0)return new f(r?-s:s,1n);t=1/i;let[o,a]=[1n,s],[l,u]=[0n,1n];for(;`${u}`.length<e+1;){const h=BigInt(Math.floor(t)),d=t-Number(h);if([o,a]=[a,h*a+o],[l,u]=[u,h*u+l],d===0)return new f(r?-a:a,u);t=1/d}return new f(r?-o:o,l)}#e(){const{gcd:t}=L(this.#t,this.#n);t!==0n&&(this.#t/=t,this.#n/=t)}minus(){return new f(-this.#t,this.#n)}inverse(){return new f(this.#n,this.#t)}add(t){const e=this.#n*t.#n,r=this.#t*t.#n+t.#t*this.#n;return new f(r,e)}substr(t){return this.add(t.minus())}multiply(t){const e=this.#n*t.#n,r=this.#t*t.#t;return new f(r,e)}divide(t){return this.multiply(t.inverse())}mediant(t){const e=this.#n+t.#n,r=this.#t+t.#t;return new f(r,e)}toDecimal(){return Number(this.#t)/Number(this.#n)}toString(){return this.#t===0n&&this.#n===0n?"NaN":this.#t===0n?"0":this.#n===0n?this.#t<0n?"-Infinity":"Infinity":this.#n===1n?`${this.#t}`:`${this.#t}/${this.#n}`}valueOf(){return this.toDecimal()}toJSON(){return{type:"Rational",value:["0x"+this.#t.toString(16),"0x"+this.#n.toString(16)]}}static fromData(t){const e=BigInt(t.value[0]),r=BigInt(t.value[1]);return new f(e,r)}static parse(t){const r=/^\s*(\d+)\s*\/\s*(\d+)\s*$/.exec(t);if(!r)throw Error("cannot parse");const s=r.at(1),i=r.at(2);if(!s||!i)throw Error("cannot parse");return new f(BigInt(s),BigInt(i))}}Object.defineProperty(f.prototype,Symbol.toStringTag,{value:T});const P=n=>{const t=Array.from(n,e=>String.fromCharCode(e));return btoa(t.join(""))},C=n=>{const t=atob(n);return Uint8Array.from(t,e=>e.charCodeAt(0))},ft=n=>P(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,""),ht=n=>{const t=n.length&3;t>0&&(n=n+"=".repeat(4-t));const e=n.replaceAll("-","+").replaceAll("_","/");return C(e)},dt=n=>{let t=Array.from(n,i=>i.toString(16).padStart(2,"0")).join("");const e=t.length%6;e&&(t="0".repeat(6-e)+t);const r=t.matchAll(/.{6}/g);return Array.from(r,i=>Number.parseInt(i[0],16).toString(8).padStart(8,"0")).join("").replace(/^0+/,"")},gt=n=>{const t=n.length&7;t&&(n="0".repeat(8-t)+n);const e=n.matchAll(/.{8}/g),s=Array.from(e,i=>{const o=i[0];return Number.parseInt(o,8).toString(16).padStart(6,"0")}).join("").matchAll(/.{2}/g);return Uint8Array.from(s,i=>Number.parseInt(i[0],16))},mt=n=>{const t=n<0n;t&&(n*=-1n);const e=n.toString(2).length,r=n===1n<<BigInt(e-1)&&!(e%7)&&t,s=Math.floor(e/7)+1;return r?s-1:s},yt=n=>{const t=mt(n);n=BigInt.asUintN(t*7,n);const e=new Uint8Array(t);for(let s=0;s<t-1;++s){const i=Number(n&127n)|128;e[s]=i,n>>=7n}const r=Number(n&127n);return e[t-1]=r,n>>=7n,e},pt=n=>{const t=n.length;let e=0n;for(let r=0;r<t;++r){const s=BigInt(n[r]&127);e+=s<<BigInt(7*r)}return BigInt.asIntN(7*t,e)},j=n=>{if(n===0)return 32;let t=0;for(;n>0&&!(n&1);)++t,n>>>=1;return t},_="FloatRng",O=n=>{if(n===0n)return 64n;let t=0n;for(;n>0n&&!(n&1n);)++t,n>>=1n;return BigInt.asUintN(64,t)};class F{#t;static name=_;constructor(t){this.#t=t}#n(){const r=(()=>{switch(this.#t.bits){case 32:return this.#t.getU32Rand()>>>0;case 64:{const l=this.#t.getU64Rand()&0xffffffffn;return Number(l)}}})(),s=r&255;let i=126;if(s===0){i-=8;const l=1e5;let u=0;t:for(;;){if(u>l)throw Error("loop exceeded limit");const h=(()=>{switch(this.#t.bits){case 32:return this.#t.getU32Rand()>>>0;case 64:{const d=BigInt.asUintN(32,this.#t.getU64Rand());return Number(d)}}})();if(h===0){if(i-=32,i<0){i=0;break t}}else{i-=j(h);break t}++u}}else i-=j(s);const o=r>>>8&8388607;o===0&&r>>>31&&++i;const a=Uint32Array.from([i<<23|o]);return new Float32Array(a.buffer)[0]}getF32Rand(){for(let e=0;e<1e5;++e){const r=this.#n();if(r<1)return r}throw Error("exceeded loop limit")}#e(){const t=0n,e=1023n,r=(()=>{switch(this.#t.bits){case 32:{const l=BigInt(this.#t.getU32Rand()>>>0),u=BigInt(this.#t.getU32Rand()>>>0);return l<<32n|u}case 64:return BigInt.asUintN(64,this.#t.getU64Rand())}})(),s=r&0x7ffn;let i=e-1n;if(s===0n){i-=11n;const l=1e5;let u=0;t:for(;;){if(u>l)throw Error("loop exceeded limit");const h=(()=>{switch(this.#t.bits){case 32:{const d=BigInt(this.#t.getU32Rand()>>>0),R=BigInt(this.#t.getU32Rand()>>>0);return d<<32n|R}case 64:return BigInt.asUintN(64,this.#t.getU64Rand())}})();if(h===0n){if(i-=64n,i<t){i=t;break t}}else{i-=O(h);break t}++u}}else i-=O(s);const o=BigInt.asUintN(52,r>>11n);o===0n&&r>>63n&&++i;const a=BigUint64Array.from([i<<52n|o]);return new Float64Array(a.buffer)[0]}getF64Rand(){for(let e=0;e<1e5;++e){const r=this.#e();if(r<1)return r}throw Error("exceeded loop limit")}}Object.defineProperty(F.prototype,Symbol.toStringTag,{value:_});const It=[0x853c49e6748fea9bn,0xda3e39cb94b95bdbn],wt=0x5851f42d4c957f2dn,V="PCGMinimal";class ${#t;static name=V;bits=32;constructor(t){t&&t.length>=2?(this.#t=new BigUint64Array(2),this.#t[1]=t[1]<<1n|1n,this.#n(),this.#t[0]+=t[0],this.#n()):this.#t=BigUint64Array.from(It)}#n(){this.#t[0]=this.#t[0]*wt+this.#t[1]}get#e(){const t=this.#t[0],e=Number(t>>59n),r=Number(BigInt.asUintN(32,(t^t>>18n)>>27n));return M(r,e)}getU32Rand(){return this.#n(),this.#e}getBoundedU32Rand(t){if(t>4294967296)throw Error("`bound` exceeded limit (2^32)");if(t<=0)throw Error("'bound' must be positive");const r=4294967296%t,s=1e5;for(let i=0;i<s;++i){const o=this.getU32Rand();if(o>=r)return o%t}throw Error("exceeded loop limit")}*genU32Rands(t,e){if(t<=0)throw Error("'step' must be positive");for(let r=0;r<t;r++)yield typeof e=="number"?this.getBoundedU32Rand(e):this.getU32Rand()}}Object.defineProperty($.prototype,Symbol.toStringTag,{value:V});const bt=[0xbe562cb412e2260en,0x2e4284137d641affn,0x4e19b36ee933e27en,0x7581cf8c4f4d4f7dn];class U{bits=64;#t;static name="XoshiroMinimal";constructor(t){t&&t.length>=4?(this.#t=new BigUint64Array(4),this.#t[0]=t[0],this.#t[1]=t[1],this.#n(),this.#t[2]+=t[2],this.#t[3]+=t[3]):this.#t=BigUint64Array.from(bt)}#n(){const t=this.#t[1]<<17n;this.#t[2]^=this.#t[0],this.#t[3]^=this.#t[1],this.#t[1]^=this.#t[2],this.#t[0]^=this.#t[3],this.#t[2]^=t,this.#t[3]=b(this.#t[3],45n)}get value(){const t=b(this.#t[0]+this.#t[3],23n)+this.#t[0];return BigInt.asUintN(64,t)}getU64Rand(){const t=this.value;return this.#n(),t}getU32Rand(){const t=BigInt.asUintN(32,this.getU64Rand());return Number(t)}getBoundedU64Rand(t){const e=1n<<64n;if(t>e)throw Error("'bound' exceeded limit");if(t<=0n)throw Error("'bound' must be positive");const r=e%t,s=1e5;for(let i=0;i<s;++i){const o=this.getU64Rand();if(o>=r)return o%t}throw Error("exceeded loop limit")}getBoundedU32Rand(t){if(t>4294967296)throw Error("'bound' exceeded limit");if(t<=0n)throw Error("'bound' must be positive");const r=this.getBoundedU64Rand(BigInt(t));return Number(r)}*genU64Rands(t,e){if(t<=0)throw Error("'step' must be positive");for(let r=0;r<t;++r)yield e===void 0?this.getU64Rand():this.getBoundedU64Rand(e)}*genU32Rands(t,e){if(t<=0)throw Error("'step' must be positive");for(let r=0;r<t;++r)yield e===void 0?this.getU32Rand():this.getBoundedU32Rand(e)}}Object.defineProperty(U.prototype,Symbol.toStringTag,{value:U.name});const D="WorkerStream";class q extends ReadableStream{close;#t;static name=D;constructor(t,e){let r,s,i;super({start:o=>{r=a=>{o.enqueue(a.data)},s=a=>{t.removeEventListener("message",r),t.removeEventListener("error",s);const l=new p("WorkerStreamError",a.message,{cause:a.error});o.error(l)},i=()=>{t.removeEventListener("message",r),t.removeEventListener("error",s),o.close()},t.addEventListener("message",r),t.addEventListener("error",s)},cancel:o=>{console.log("Canceled reason:",o),t.removeEventListener("message",r),t.removeEventListener("error",s)}},e),this.close=i,this.#t=t}postMessage(t,e){this.#t.postMessage(t,e)}}return Object.defineProperty(q.prototype,Symbol.toStringTag,{value:D}),c.FloatRng=F,c.NamedError=p,c.PCGMinimal=$,c.Rational=f,c.WorkerStream=q,c.XoshiroMinimal=U,c.bailliePSW=S,c.compress=Q,c.decodeLEB128=pt,c.decodeRFC3986URIComponent=x,c.decompress=tt,c.encodeLEB128=yt,c.encodeRFC3986URIComponent=Z,c.exEuclidean=L,c.factorial=st,c.fromBase64=C,c.fromBase64Url=ht,c.fromOct=gt,c.getHash=J,c.getRandBIByBitLength=I,c.getRandBIByRange=v,c.getRandPrimeByBitLength=ut,c.getRandPrimeByRange=lt,c.getRndInt=et,c.getStringTag=z,c.isDeepStrictEqual=g,c.isNode=Y,c.isSquare=A,c.jacobiSymbol=E,c.lazify=X,c.modPow=y,c.parseCSV=H,c.residue=m,c.rot32=M,c.rot64=b,c.sameValueZero=K,c.setTimeoutPromise=nt,c.sleep=G,c.toBase64=P,c.toBase64Url=ft,c.toOct=dt,c.withResolvers=W,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),c})({});
|
|
1
|
+
var UtilFns=(function(c){"use strict";const $=new TextEncoder,D=(n,t)=>[n].includes(t),h=(n,t)=>{if(typeof n!=typeof t)return!1;const e=Object.prototype.toString.call(n),r=Object.prototype.toString.call(t);if(e!==r)return!1;if(typeof n=="string"||typeof n=="bigint"||typeof n=="boolean"||typeof n=="symbol"||n==null)return n===t;if(typeof n=="number")return n!==n&&t!==t||n===t;if(typeof n=="function")return!1;if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return!1;for(let s=0;s<n.length;s++)if(!h(n[s],t[s]))return!1;return!0}if(n instanceof Set&&t instanceof Set){const s=[...n.values()],o=[...t.values()];return!!h(s,o)}if(n instanceof Map&&t instanceof Map){const s=[...n.keys()],o=[...t.keys()];if(!h(s,o))return!1;const i=[...n.values()],a=[...t.values()];return!!h(i,a)}if(e==="[object Object]"){const s=n,o=t,i=Object.keys(s),a=Object.keys(o);for(const l of i){const f=a.find(It=>It===l);if(f===void 0)return!1;const[m,p]=[s[l],o[f]];if(!h(m,p))return!1}return!0}throw Error(`comparing these objects is unavailable: ${n}, ${t}`,{cause:[n,t]})},q=()=>{let n,t;return{promise:new Promise((r,s)=>{n=r,t=s}),resolve:n,reject:t}},K=n=>new Promise(t=>{setTimeout(()=>t(),n)}),W=n=>{const t=Object.prototype.toString.call(n);return t.slice(8,t.length-1)},G=n=>(...t)=>()=>n(...t),X=n=>{const t=[];let e=[],r="",s=!1;for(let o=0;o<n.length;o++){const i=n[o];i==='"'&&(o===0||n[o-1]!=="\\")?s=!s:i===","&&!s?(e.push(r.trim()),r=""):i===`
|
|
2
|
+
`&&!s?(e.push(r.trim()),t.push(e),e=[],r=""):r+=i}return e.push(r.trim()),t.push(e),t},k=async(n,t)=>{const e=$.encode(n),r=await crypto.subtle.digest(t,e);return new Uint8Array(r)},z=n=>encodeURIComponent(n).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),H=n=>{if(n.includes("+"))throw Error("An input string has '+'");return decodeURIComponent(n)},J=async(n,t)=>{const r=new Blob([n]).stream().pipeThrough(new CompressionStream(t));return new Response(r).bytes()},Y=async(n,t)=>{const r=new Blob([n]).stream().pipeThrough(new DecompressionStream(t));return new Response(r).bytes()},Z=(n,t)=>new Promise((e,r)=>{setTimeout(async()=>{try{const s=await n();e(s)}catch(s){r(s)}},t)}),N="NamedError";class y extends Error{constructor(t,e,r){super(e,r),this.errName=t}static name=N;toJSON(){const t=(()=>{const o=this.cause;if(o!=null)return typeof o=="string"||typeof o=="number"||typeof o=="boolean"?o:typeof o=="bigint"?o.toString():typeof o=="object"?o instanceof Set||o instanceof Map?Object.fromEntries(o):o:void 0})(),{errName:e,message:r,stack:s}=this;return{errName:e,message:r,stack:s,cause:t}}}Object.defineProperty(y.prototype,Symbol.toStringTag,{value:N});const Q=(n,t)=>Math.floor(Math.random()*(t-n)+n),d=(n,t)=>{t<0n&&(t*=-1n);const e=n%t;return e<0n?e+t:e},I=(n,t=!1)=>{if(!Number.isFinite(n))throw Error("`length` is not a valid number");if(n<=0)throw Error("`length` must be positive");const e=Math.ceil(n/8),r=crypto.getRandomValues(new Uint8Array(e));let s=Array.from(r,o=>o.toString(2).padStart(8,"0")).join("").slice(0,n);return t&&(s=s.replace(/^\d/,"1")),BigInt("0b"+s)},R=(n,t)=>{if(n>=t)throw new y("RangeError","min is larger than max");const e=t-n,r=e.toString(2).length,s=(()=>{for(let i=0;i<1e5;i++){const a=I(r);if(a>=g(2n,BigInt(r),e))return a%e}throw Error("Failed to generate a random bigint")})();return n+s},g=(n,t,e)=>{if(e<1n)throw Error("`mod` must be positive");if(t<0n)throw Error("`power` must not be negative");if(n=d(n,e),e===1n)return 0n;if(n%e===1n||n%e===0n)return n;if(n===e-1n)return t&1n?e-1n:1n;let r=1n;for(;t>0n;)t&1n&&(r=r*n%e),n=n*n%e,t>>=1n;return r},v=(n,t)=>{if(n===0n&&t===0n)return{x:0n,y:0n,gcd:0n};if(n===0n)return t>0n?{x:0n,y:-1n,gcd:t}:{x:0n,y:1n,gcd:-t};if(t===0n)return n>0n?{x:1n,y:0n,gcd:n}:{x:-1n,y:0n,gcd:-n};let[e,r,s]=[1n,0n,n],[o,i,a]=[0n,-1n,t];for(;;){const l=s/a,f=s-l*a;if(f===0n)break;[e,o]=[o,e-l*o],[r,i]=[i,r-l*i],[s,a]=[a,f]}return a<0n&&(o*=-1n,i*=-1n,a*=-1n),{x:o,y:i,gcd:a}},w=(n,t)=>{if(n>=t)return 1n;const e=BigInt((t-2n).toString(2).length),r=(t-n)/2n;if(e*r<63n){let a=n;for(let l=n+2n;l<t;l+=2n)a*=l;return a}const s=n+r|1n,o=w(n,s),i=w(s,t);return o*i},x=n=>{let t=3n,e=1n,r=1n;const s=BigInt(n.toString(2).length)-1n;for(let o=s-1n;o>-1n;--o){const i=(n>>o)+1n|1n;r*=w(t,i),t=i,e*=r}return e},tt=n=>{if(n<0n)throw Error("'n' must be non-negative");if(n===0n)return 1n;const t=n-BigInt(n.toString(2).match(/1/g)?.length??0);return x(n)<<t},L=(n,t)=>(n>>>(t&31)|n<<(-t&31))>>>0,B=(n,t)=>BigInt.asUintN(64,n>>(t&63n)|n<<(-t&63n)),E=(n,t)=>{if(t<1n||t%2n===0n)throw Error("`n` is invalid");for(;n<0n;)n+=t;n%=t;let e=1n;for(;n!==0n;){for(;n%2n===0n;){n/=2n;const r=t%8n;(r===3n||r===5n)&&(e*=-1n)}[n,t]=[t,n],n%4n===3n&&t%4n===3n&&(e*=-1n),n%=t}return t===1n?e:0n},M=n=>{if(n<0n)return!1;if(n===0n)return!0;let t=1n,e=n;for(;t+1n<e;){const r=(t+e)/2n;r*r<n?t=r:e=r}return n===t**2n||n===(t+1n)**2n},nt=n=>{if(n<=1n)return!1;if(n%2n===0n)return n===2n;let t=n-1n,e=0n;for(;t%2n===0n;)t>>=1n,e+=1n;const[r,s]=[t,e];let i=g(2n,r,n);if(i===1n)return!0;for(let a=0n;a<s;a++){if(i===n-1n)return!0;i=i*i%n}return!1},et=n=>{let t=5n,e=E(t,n);for(;e>0n;){if(t=t>0n?t+2n:t-2n,t*=-1n,t===-15n&&M(n))return[0n,0n];e=E(t,n)}return[t,e]},b=(n,t)=>(n&1n)===1n?d(n+t>>1n,t):d(n>>1n,t),rt=(n,t,e,r)=>{let s=1n,o=e;const i=n.toString(2).slice(1);for(const a of i)[s,o]=[d(s*o,t),b(o*o+r*s*s,t)],a==="1"&&([s,o]=[b(e*s+o,t),b(r*s+e*o,t)]);return[s,o]},st=(n,t,e,r)=>{if(n%2n!==1n)throw Error("`n` must be odd");let s=n+1n,o=0n;for(;s%2n===0n;)s>>=1n,o+=1n;const[i,a]=rt(s,n,e,t);let l=a;if(i===0n)return!0;r=g(r,s,n);for(let f=0n;f<o;f++){if(l===0n)return!0;l=d(l*l-2n*r,n),r=g(r,2n,n)}return!1},S=n=>{if(n<=1n)return!1;if(n%2n===0n)return n===2n;const t=[2n,3n,5n,7n,11n,13n,17n,19n,23n,29n,31n,37n,41n,43n,47n,53n,59n,61n,67n,71n,73n,79n,83n,89n,97n,101n];for(const o of t)if(n%o===0n)return n===o;if(!nt(n))return!1;const[e,r]=et(n);if(r===0n)return!1;const s=(1n-e)/4n;return st(n,e,1n,s)},ot=(n,t)=>{if(t<2n)throw Error("NoPrimesFound");for(let r=0;r<1e5;r++){const s=R(n,t);if(S(s))return s}throw Error("NoPrimesFound")},it=(n,t=!1)=>{if(n<2)throw Error("NoPrimesFound");for(let r=0;r<1e5;r++){const s=I(n,t);if(S(s))return s}throw Error("NoPrimesFound")},A="Rational";class u{#t;#n;static name=A;constructor(t,e){e===0n?(this.#n=0n,this.#t=t===0n?0n:t>0n?1n:-1n):e>0n?(this.#t=t,this.#n=e):(this.#t=-t,this.#n=-e),this.#e()}static fromDecimal(t,e=5){if(Number.isNaN(t))return new u(0n,0n);if(Math.abs(t)===1/0)return new u(t>0?1n:-1n,0n);const r=t<0;r&&(t*=-1);const s=BigInt(Math.floor(t)),o=t-Number(s);if(o===0)return new u(r?-s:s,1n);t=1/o;let[i,a]=[1n,s],[l,f]=[0n,1n];for(;`${f}`.length<e+1;){const m=BigInt(Math.floor(t)),p=t-Number(m);if([i,a]=[a,m*a+i],[l,f]=[f,m*f+l],p===0)return new u(r?-a:a,f);t=1/p}return new u(r?-i:i,l)}#e(){const{gcd:t}=v(this.#t,this.#n);t!==0n&&(this.#t/=t,this.#n/=t)}minus(){return new u(-this.#t,this.#n)}inverse(){return new u(this.#n,this.#t)}add(t){const e=this.#n*t.#n,r=this.#t*t.#n+t.#t*this.#n;return new u(r,e)}substr(t){return this.add(t.minus())}multiply(t){const e=this.#n*t.#n,r=this.#t*t.#t;return new u(r,e)}divide(t){return this.multiply(t.inverse())}mediant(t){const e=this.#n+t.#n,r=this.#t+t.#t;return new u(r,e)}toDecimal(){return Number(this.#t)/Number(this.#n)}toString(){return this.#t===0n&&this.#n===0n?"NaN":this.#t===0n?"0":this.#n===0n?this.#t<0n?"-Infinity":"Infinity":this.#n===1n?`${this.#t}`:`${this.#t}/${this.#n}`}valueOf(){return this.toDecimal()}toJSON(){return{type:"Rational",value:["0x"+this.#t.toString(16),"0x"+this.#n.toString(16)]}}static fromData(t){const e=BigInt(t.value[0]),r=BigInt(t.value[1]);return new u(e,r)}static parse(t){const r=/^\s*(\d+)\s*\/\s*(\d+)\s*$/.exec(t);if(!r)throw Error("cannot parse");const s=r.at(1),o=r.at(2);if(!s||!o)throw Error("cannot parse");return new u(BigInt(s),BigInt(o))}}Object.defineProperty(u.prototype,Symbol.toStringTag,{value:A});const T=n=>{const t=Array.from(n,e=>String.fromCharCode(e));return btoa(t.join(""))},P=n=>{const t=atob(n);return Uint8Array.from(t,e=>e.charCodeAt(0))},ct=n=>T(n).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,""),at=n=>{const t=n.length&3;t>0&&(n=n+"=".repeat(4-t));const e=n.replaceAll("-","+").replaceAll("_","/");return P(e)},lt=n=>{let t=Array.from(n,o=>o.toString(16).padStart(2,"0")).join("");const e=t.length%6;e&&(t="0".repeat(6-e)+t);const r=t.matchAll(/.{6}/g);return Array.from(r,o=>Number.parseInt(o[0],16).toString(8).padStart(8,"0")).join("").replace(/^0+/,"")},ut=n=>{const t=n.length&7;t&&(n="0".repeat(8-t)+n);const e=n.matchAll(/.{8}/g),s=Array.from(e,o=>{const i=o[0];return Number.parseInt(i,8).toString(16).padStart(6,"0")}).join("").matchAll(/.{2}/g);return Uint8Array.from(s,o=>Number.parseInt(o[0],16))},ft=n=>{const t=n<0n;t&&(n*=-1n);const e=n.toString(2).length,r=n===1n<<BigInt(e-1)&&!(e%7)&&t,s=Math.floor(e/7)+1;return r?s-1:s},ht=n=>{const t=ft(n);n=BigInt.asUintN(t*7,n);const e=new Uint8Array(t);for(let s=0;s<t-1;++s){const o=Number(n&127n)|128;e[s]=o,n>>=7n}const r=Number(n&127n);return e[t-1]=r,n>>=7n,e},dt=n=>{const t=n.length;let e=0n;for(let r=0;r<t;++r){const s=BigInt(n[r]&127);e+=s<<BigInt(7*r)}return BigInt.asIntN(7*t,e)},C=n=>{if(n===0n)return 64n;let t=0n;for(;n>0n&&!(n&1n);)++t,n>>=1n;return BigInt.asUintN(64,t)},j=(n,t)=>{const e=0n,r=1023n,s=n&0x7ffn;let o=r-1n;if(s>0n)return o-=C(s),o;o-=11n;const i=1e5;for(let a=0;a<i;++a){const l=t();if(l>0n)return o-=C(l),o;if(o-=64n,o<e)return e}throw Error("loop exceeded limit")},gt=n=>{const t=()=>BigInt.asUintN(64,n()),e=()=>{const r=t(),s=BigInt.asUintN(52,r>>11n),i=s===0n&&r>>63n===1n?j(r,t)+1n:j(r,t),{buffer:a}=BigUint64Array.from([i<<52n|s]);return new Float64Array(a)[0]};return()=>{for(let s=0;s<1e5;++s){const o=e();if(o<1)return o}throw Error("Loop limit exceeded")}},mt=[0x853c49e6748fea9bn,0xda3e39cb94b95bdbn],yt=0x5851f42d4c957f2dn,O="PCGMinimal";class _{#t;static name=O;constructor(t){t&&t.length>=2?(this.#t=new BigUint64Array(2),this.#t[1]=t[1]<<1n|1n,this.#n(),this.#t[0]+=t[0],this.#n()):this.#t=BigUint64Array.from(mt)}#n(){this.#t[0]=this.#t[0]*yt+this.#t[1]}get#e(){const t=this.#t[0],e=Number(t>>59n),r=Number(BigInt.asUintN(32,(t^t>>18n)>>27n));return L(r,e)}getRandU32(){return this.#n(),this.#e}getBoundedRandU32(t){if(t>4294967296)throw Error("`bound` exceeded limit (2^32)");if(t<=0)throw Error("'bound' must be positive");const r=4294967296%t,s=1e5;for(let o=0;o<s;++o){const i=this.getRandU32();if(i>=r)return i%t}throw Error("exceeded loop limit")}*genRandU32s(t,e){if(t<=0)throw Error("'step' must be positive");for(let r=0;r<t;r++)yield typeof e=="number"?this.getBoundedRandU32(e):this.getRandU32()}}Object.defineProperty(_.prototype,Symbol.toStringTag,{value:O});const pt=[0xbe562cb412e2260en,0x2e4284137d641affn,0x4e19b36ee933e27en,0x7581cf8c4f4d4f7dn];class U{bits=64;#t;static name="XoshiroMinimal";constructor(t){t&&t.length>=4?(this.#t=new BigUint64Array(4),this.#t[0]=t[0],this.#t[1]=t[1],this.#n(),this.#t[2]+=t[2],this.#t[3]+=t[3]):this.#t=BigUint64Array.from(pt)}#n(){const t=this.#t[1]<<17n;this.#t[2]^=this.#t[0],this.#t[3]^=this.#t[1],this.#t[1]^=this.#t[2],this.#t[0]^=this.#t[3],this.#t[2]^=t,this.#t[3]=B(this.#t[3],45n)}get value(){const t=B(this.#t[0]+this.#t[3],23n)+this.#t[0];return BigInt.asUintN(64,t)}getRandU64(){const t=this.value;return this.#n(),t}getRandU32(){const t=BigInt.asUintN(32,this.getRandU64());return Number(t)}getBoundedRandU64(t){const e=1n<<64n;if(t>e)throw Error("'bound' exceeded limit");if(t<=0n)throw Error("'bound' must be positive");const r=e%t,s=1e5;for(let o=0;o<s;++o){const i=this.getRandU64();if(i>=r)return i%t}throw Error("exceeded loop limit")}getBoundedRandU32(t){if(t>4294967296)throw Error("'bound' exceeded limit");if(t<=0n)throw Error("'bound' must be positive");const r=this.getBoundedRandU64(BigInt(t));return Number(r)}*genRandU64s(t,e){if(t<=0)throw Error("'step' must be positive");for(let r=0;r<t;++r)yield e===void 0?this.getRandU64():this.getBoundedRandU64(e)}*genRandU32s(t,e){if(t<=0)throw Error("'step' must be positive");for(let r=0;r<t;++r)yield e===void 0?this.getRandU32():this.getBoundedRandU32(e)}}Object.defineProperty(U.prototype,Symbol.toStringTag,{value:U.name});const F="WorkerStream";class V extends ReadableStream{close;#t;static name=F;constructor(t,e){let r,s,o;super({start:i=>{r=a=>{i.enqueue(a.data)},s=a=>{t.removeEventListener("message",r),t.removeEventListener("error",s);const l=new y("WorkerStreamError",a.message,{cause:a.error});i.error(l)},o=()=>{t.removeEventListener("message",r),t.removeEventListener("error",s),i.close()},t.addEventListener("message",r),t.addEventListener("error",s)},cancel:i=>{console.log("Canceled reason:",i),t.removeEventListener("message",r),t.removeEventListener("error",s)}},e),this.close=o,this.#t=t}postMessage(t,e){this.#t.postMessage(t,e)}}return Object.defineProperty(V.prototype,Symbol.toStringTag,{value:F}),c.NamedError=y,c.PCGMinimal=_,c.Rational=u,c.WorkerStream=V,c.XoshiroMinimal=U,c.bailliePSW=S,c.compress=J,c.decodeLEB128=dt,c.decodeRFC3986URIComponent=H,c.decompress=Y,c.encodeLEB128=ht,c.encodeRFC3986URIComponent=z,c.exEuclidean=v,c.factorial=tt,c.floatRng=gt,c.fromBase64=P,c.fromBase64Url=at,c.fromOct=ut,c.getHash=k,c.getRandBIByBitLength=I,c.getRandBIByRange=R,c.getRandPrimeByBitLength=it,c.getRandPrimeByRange=ot,c.getRndInt=Q,c.getStringTag=W,c.isDeepStrictEqual=h,c.isSquare=M,c.jacobiSymbol=E,c.lazify=G,c.modPow=g,c.parseCSV=X,c.residue=d,c.rot32=L,c.rot64=B,c.sameValueZero=D,c.setTimeoutPromise=Z,c.sleep=K,c.toBase64=T,c.toBase64Url=ct,c.toOct=lt,c.withResolvers=q,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),c})({});
|
package/dist/pcg_minimal.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { RandomGenerator32 } from './random';
|
|
2
1
|
/**
|
|
3
2
|
* PCG-XSH-RR (Permuted congruential generator) \
|
|
4
3
|
* reference: https://github.com/imneme/pcg-c-basic/blob/bc39cd76ac3d541e618606bcc6e1e5ba5e5e6aa3/pcg_basic.c \
|
|
5
4
|
* by Melissa O'Neill
|
|
6
5
|
*/
|
|
7
|
-
export declare class PCGMinimal
|
|
6
|
+
export declare class PCGMinimal {
|
|
8
7
|
#private;
|
|
9
8
|
static readonly name = "PCGMinimal";
|
|
10
|
-
readonly bits = 32;
|
|
11
9
|
/**
|
|
12
10
|
* @param seeds
|
|
13
11
|
* `BigUint64Array` with length 2. \
|
|
@@ -26,11 +24,11 @@ export declare class PCGMinimal implements RandomGenerator32 {
|
|
|
26
24
|
*
|
|
27
25
|
* @returns a random 32-bit unsigned integer
|
|
28
26
|
*/
|
|
29
|
-
|
|
27
|
+
getRandU32(): number;
|
|
30
28
|
/**
|
|
31
29
|
* @returns a random 32-bit unsigned integer less than `bound`
|
|
32
30
|
*/
|
|
33
|
-
|
|
31
|
+
getBoundedRandU32(bound: number): number;
|
|
34
32
|
/**
|
|
35
33
|
*
|
|
36
34
|
* @param step the number of needed random integers
|
|
@@ -39,5 +37,5 @@ export declare class PCGMinimal implements RandomGenerator32 {
|
|
|
39
37
|
* the iterator that generates random 32-bit unsigned integers `step` times \
|
|
40
38
|
* if `bound` is given, random integers are less than `bound`
|
|
41
39
|
*/
|
|
42
|
-
|
|
40
|
+
genRandU32s(step: number, bound?: number): Generator<number, void, unknown>;
|
|
43
41
|
}
|
package/dist/random.d.ts
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly bits: 32;
|
|
3
|
-
getU32Rand: () => number;
|
|
4
|
-
}
|
|
5
|
-
export interface RandomGenerator64 {
|
|
6
|
-
readonly bits: 64;
|
|
7
|
-
getU64Rand: () => bigint;
|
|
8
|
-
}
|
|
9
|
-
export declare class FloatRng<TRng extends RandomGenerator32 | RandomGenerator64> {
|
|
10
|
-
#private;
|
|
11
|
-
static readonly name = "FloatRng";
|
|
12
|
-
constructor(rng: TRng);
|
|
13
|
-
/**
|
|
14
|
-
* returns a random single-precision floating-point number (float32) in the range of [0.0, 1.0)
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
getF32Rand(): number;
|
|
18
|
-
/**
|
|
19
|
-
* returns a random double-precision floating-point number (float64) in the range of [0.0, 1.0)
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
getF64Rand(): number;
|
|
23
|
-
}
|
|
1
|
+
export declare const floatRng: (getRandU64: () => bigint) => () => number;
|
package/dist/util.d.ts
CHANGED
|
@@ -51,11 +51,6 @@ export declare const parseCSV: (csv: string) => string[][];
|
|
|
51
51
|
* @returns hash
|
|
52
52
|
*/
|
|
53
53
|
export declare const getHash: (str: string, algorithm: AlgorithmIdentifier) => Promise<Uint8Array<ArrayBuffer>>;
|
|
54
|
-
/**
|
|
55
|
-
* whether the environment is Node.js
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
export declare const isNode: () => boolean;
|
|
59
54
|
/**
|
|
60
55
|
* Encodes a text string as a valid component of a URI and compatible with RFC3986.
|
|
61
56
|
* @param URIComponent
|
|
@@ -74,7 +69,7 @@ export declare const decompress: (compressed: Uint8Array<ArrayBuffer>, format: C
|
|
|
74
69
|
/**
|
|
75
70
|
* Schedules execution of a one-time `callback` after `delay` milliseconds, and returns promise resolved by a return value of `callback`.
|
|
76
71
|
* @param callback
|
|
77
|
-
* @param delay
|
|
72
|
+
* @param delay
|
|
78
73
|
* @returns
|
|
79
74
|
*/
|
|
80
75
|
export declare const setTimeoutPromise: <TRtrn>(callback: () => TRtrn, delay?: number) => Promise<TRtrn>;
|
package/dist/worker_stream.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { RandomGenerator64 } from './random';
|
|
2
1
|
/**
|
|
3
2
|
* Xoshiro256++ \
|
|
4
3
|
* reference: https://prng.di.unimi.it/xoshiro256plusplus.c \
|
|
5
4
|
* by David Blackman and Sebastiano Vigna
|
|
6
5
|
*/
|
|
7
|
-
export declare class XoshiroMinimal
|
|
6
|
+
export declare class XoshiroMinimal {
|
|
8
7
|
#private;
|
|
9
8
|
readonly bits = 64;
|
|
10
9
|
static readonly name = "XoshiroMinimal";
|
|
@@ -23,10 +22,10 @@ export declare class XoshiroMinimal implements RandomGenerator64 {
|
|
|
23
22
|
*/
|
|
24
23
|
constructor(seed?: BigUint64Array<ArrayBuffer>);
|
|
25
24
|
get value(): bigint;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
getRandU64(): bigint;
|
|
26
|
+
getRandU32(): number;
|
|
27
|
+
getBoundedRandU64(bound: bigint): bigint;
|
|
28
|
+
getBoundedRandU32(bound: number): number;
|
|
29
|
+
genRandU64s(step: number, bound?: bigint): Generator<bigint, void, unknown>;
|
|
30
|
+
genRandU32s(step: number, bound?: number): Generator<number, void, unknown>;
|
|
32
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tktb-tess/util-fns",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "Utility functions for personal use",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"import": "./dist/bundle.js"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": "
|
|
21
|
-
"pnpm": "
|
|
20
|
+
"node": ">=22",
|
|
21
|
+
"pnpm": ">=10"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -26,15 +26,16 @@
|
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://github.com/tktb-tess/util-fns/blob/main/README.md",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "^25.0.
|
|
29
|
+
"@types/node": "^25.0.9",
|
|
30
30
|
"tsx": "^4.21.0",
|
|
31
31
|
"typescript": "^5.9.3",
|
|
32
|
-
"vite": "^7.3.
|
|
32
|
+
"vite": "^7.3.1",
|
|
33
33
|
"vite-plugin-dts": "^4.5.4",
|
|
34
|
-
"vitest": "^4.0.
|
|
34
|
+
"vitest": "^4.0.17"
|
|
35
35
|
},
|
|
36
36
|
"volta": {
|
|
37
|
-
"node": "
|
|
37
|
+
"node": "24.13.0",
|
|
38
|
+
"pnpm": "10.28.0"
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
41
|
"dev": "vite",
|
package/dist/icon.svg
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
-
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
-
|
|
4
|
-
<svg viewBox="0 0 1080 1080" version="1.1" id="svg1"
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
xmlns:svg="http://www.w3.org/2000/svg"
|
|
7
|
-
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
8
|
-
xmlns:cc="http://creativecommons.org/ns#">
|
|
9
|
-
<defs id="defs1" />
|
|
10
|
-
<metadata id="metadata1">
|
|
11
|
-
<rdf:RDF>
|
|
12
|
-
<cc:Work rdf:about="">
|
|
13
|
-
<cc:license rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
|
|
14
|
-
</cc:Work>
|
|
15
|
-
<cc:License rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
|
|
16
|
-
<cc:permits rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
|
17
|
-
<cc:permits rdf:resource="http://creativecommons.org/ns#Distribution" />
|
|
18
|
-
<cc:permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
|
19
|
-
</cc:License>
|
|
20
|
-
</rdf:RDF>
|
|
21
|
-
</metadata>
|
|
22
|
-
<path id="path1" d="M 1080,540 A 540,540 0 0 1 540,1080 540,540 0 0 1 0,540 540,540 0 0 1 540,0 540,540 0 0 1 1080,540 Z" />
|
|
23
|
-
</svg>
|