Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cids

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cids - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="1.0.1"></a>
## [1.0.1](https://github.com/multiformats/js-cid/compare/v1.0.0...v1.0.1) (2020-09-25)
### Bug Fixes
* never return Node.js Buffers ([3c45871](https://github.com/multiformats/js-cid/commit/3c45871)), closes [#126](https://github.com/multiformats/js-cid/issues/126)
<a name="1.0.0"></a>

@@ -2,0 +12,0 @@ # [1.0.0](https://github.com/multiformats/js-cid/compare/v0.8.3...v1.0.0) (2020-08-04)

3

dist/index.min.js

@@ -1,2 +0,1 @@

/*! For license information please see index.min.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cids=t():e.Cids=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e){e.exports=JSON.parse('{"identity":0,"ip4":4,"tcp":6,"sha1":17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"blake3":30,"dccp":33,"murmur3-128":34,"murmur3-32":35,"ip6":41,"ip6zone":42,"path":47,"multicodec":48,"multihash":49,"multiaddr":50,"multibase":51,"dns":53,"dns4":54,"dns6":55,"dnsaddr":56,"protobuf":80,"cbor":81,"raw":85,"dbl-sha2-256":86,"rlp":96,"bencode":99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,"sctp":132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,"stellar-block":208,"stellar-tx":209,"md4":212,"md5":213,"bmt":214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,"zeronet":230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,"udp":273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,"udt":301,"utp":302,"unix":400,"p2p":421,"ipfs":421,"https":443,"onion":444,"onion3":445,"garlic64":446,"garlic32":447,"tls":448,"quic":460,"ws":477,"wss":478,"p2p-websocket-star":479,"http":480,"json":512,"messagepack":513,"libp2p-peer-record":769,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,"x11":4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46000,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332}')},function(e,t,n){"use strict";const r=n(13),i=n(20),s=n(21),{decodeText:o,encodeText:a}=n(2),u=[["identity","\0",()=>({encode:o,decode:a}),""],["base2","0",s(1),"01"],["base8","7",s(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",s(4),"0123456789abcdef"],["base16upper","F",s(4),"0123456789ABCDEF"],["base32hex","v",s(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",s(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",s(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",s(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",s(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",s(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",s(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",s(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",s(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=u.reduce((e,t)=>(e[t[0]]=new i(t[0],t[1],t[2],t[3]),e),{}),f=u.reduce((e,t)=>(e[t[1]]=c[t[0]],e),{});e.exports={names:c,codes:f}},function(e,t,n){"use strict";const{TextEncoder:r,TextDecoder:i}=n(3),s=new i,o=new r;e.exports={decodeText:e=>s.decode(e),encodeText:e=>o.encode(e),concat:function(e,t){const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}}},function(e,t,n){"use strict";t.TextEncoder=TextEncoder,t.TextDecoder=TextDecoder},function(e,t,n){"use strict";e.exports={encode:n(22),decode:n(23),encodingLength:n(24)}},function(e,t,n){"use strict";const{names:r}=n(1),{TextDecoder:i}=n(3),s=new i("utf8");e.exports=function(e,t="utf8"){if("utf8"===t||"utf-8"===t)return s.decode(e);const n=r[t];if(!n)throw new Error("Unknown base");return n.encode(e)}},function(e,t,n){"use strict";e.exports=function(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}},function(e,t,n){"use strict";const r=n(8),i=n(4),{names:s}=n(25),o=n(5),a=n(9),u=n(6),c={};for(const h in s)c[s[h]]=h;function f(e){t.decode(e)}t.names=s,t.codes=Object.freeze(c),t.toHexString=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(e,"base16")},t.fromHexString=function(e){return a(e,"base16")},t.toB58String=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(r.encode("base58btc",e)).slice(1)},t.fromB58String=function(e){const t=e instanceof Uint8Array?o(e):e;return r.decode("z"+t)},t.decode=function(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const n=i.decode(e);if(!t.isValidCode(n))throw new Error("multihash unknown function code: 0x"+n.toString(16));e=e.slice(i.decode.bytes);const r=i.decode(e);if(r<0)throw new Error("multihash invalid length: "+r);if((e=e.slice(i.decode.bytes)).length!==r)throw new Error("multihash length inconsistent: 0x"+o(e,"base16"));return{code:n,name:c[n],length:r,digest:e}},t.encode=function(e,n,r){if(!e||void 0===n)throw new Error("multihash encode requires at least two args: digest, code");const s=t.coerceCode(n);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==r&&(r=e.length),r&&e.length!==r)throw new Error("digest length should be equal to specified length.");const o=i.encode(s),a=i.encode(r);return u([o,a,e],o.length+a.length+e.length)},t.coerceCode=function(e){let n=e;if("string"==typeof e){if(void 0===s[e])throw new Error("Unrecognized hash function named: "+e);n=s[e]}if("number"!=typeof n)throw new Error("Hash function code should be a number. Got: "+n);if(void 0===c[n]&&!t.isAppCode(n))throw new Error("Unrecognized function code: "+n);return n},t.isAppCode=function(e){return e>0&&e<16},t.isValidCode=function(e){return!!t.isAppCode(e)||!!c[e]},t.validate=f,t.prefix=function(e){return f(e),e.subarray(0,2)}},function(e,t,n){"use strict";const r=n(1),{encodeText:i,decodeText:s,concat:o}=n(2);function a(e){if(r.names[e])return r.names[e];if(r.codes[e])return r.codes[e];throw new Error("Unsupported encoding: "+e)}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:n,codeBuf:r}=a(e);return function(e,t){a(e).decode(s(t))}(n,t),o([r,t],r.length+t.length)}).encode=function(e,t){const n=a(e),r=i(n.encode(t));return o([n.codeBuf,r],n.codeBuf.length+r.length)},t.decode=function(e){e instanceof Uint8Array&&(e=s(e));const t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),a(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=s(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return a(e[0]).name}catch(t){return!1}},t.encoding=a,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=s(e)),a(e[0])},t.names=Object.freeze(r.names),t.codes=Object.freeze(r.codes)},function(e,t,n){"use strict";const{names:r}=n(1),{TextEncoder:i}=n(3),s=new i;e.exports=function(e,t="utf8"){if("utf8"===t||"utf-8"===t)return s.encode(e);const n=r[t];if(!n)throw new Error("Unknown base");return n.decode(e)}},function(e,t,n){"use strict";const r=n(4),i=n(5),s=n(9);function o(e){return parseInt(i(e,"base16"),16)}function a(e){let t=e.toString(16);return t.length%2==1&&(t="0"+t),s(t,"base16")}e.exports={numberToUint8Array:a,uint8ArrayToNumber:o,varintUint8ArrayEncode:function(e){return Uint8Array.from(r.encode(o(e)))},varintUint8ArrayDecode:function(e){return a(r.decode(e))},varintEncode:function(e){return Uint8Array.from(r.encode(e))}}},function(e,t,n){e.exports=n(12)},function(e,t,n){"use strict";const r=n(7),i=n(8),s=n(26),o=n(0),a=n(31),u=n(32),c=n(6),f=n(5),h=n(33),l=Object.keys(o).reduce((e,t)=>(e[o[t]]=t,e),{});class k{constructor(e,t,n,o){if(b.isCID(e)){const t=e;return this.version=t.version,this.codec=t.codec,this.multihash=t.multihash,void(this.multibaseName=t.multibaseName||(0===t.version?"base58btc":"base32"))}if("string"==typeof e){const t=i.isEncoded(e);if(t){const n=i.decode(e);this.version=parseInt(n.slice(0,1).toString("hex"),16),this.codec=s.getCodec(n.slice(1)),this.multihash=s.rmPrefix(n.slice(1)),this.multibaseName=t}else this.version=0,this.codec="dag-pb",this.multihash=r.fromB58String(e),this.multibaseName="base58btc";return k.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const t=e.slice(0,1),n=parseInt(t.toString("hex"),16);if(1===n){const t=e;this.version=n,this.codec=s.getCodec(t.slice(1)),this.multihash=s.rmPrefix(t.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";k.validateCID(this)}else this.version=e,"number"==typeof t&&(t=l[t]),this.codec=t,this.multihash=n,this.multibaseName=o||(0===e?"base58btc":"base32"),k.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const t=s.getCodeVarint(this.codec);e=c([[1],t,this.multihash],1+t.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=s.getCodeVarint(this.codec),t=r.prefix(this.multihash);return c([[this.version],e,t],1+e.byteLength+t.byteLength)}get code(){return o[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:t}=r.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==t)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new b(0,this.codec,this.multihash)}toV1(){return new b(1,this.codec,this.multihash)}toBaseEncodedString(e=this.multibaseName){if(this.string&&e===this.multibaseName)return this.string;let t=null;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");t=r.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");t=f(i.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:t}),t}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&h(this.multihash,e.multihash)}static validateCID(e){const t=a.checkCIDComponents(e);if(t)throw new Error(t)}}const b=u(k,{className:"CID",symbolName:"@ipld/js-cid/CID"});b.codecs=o,e.exports=b},function(e,t,n){"use strict";var r=n(14).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(255!==t[o])throw new TypeError(s+" is ambiguous");t[o]=i}var a=e.length,u=e.charAt(0),c=Math.log(a)/Math.log(256),f=Math.log(256)/Math.log(a);function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return r.alloc(0);var n=0;if(" "!==e[n]){for(var i=0,s=0;e[n]===u;)i++,n++;for(var o=(e.length-n)*c+1>>>0,f=new Uint8Array(o);e[n];){var h=t[e.charCodeAt(n)];if(255===h)return;for(var l=0,k=o-1;(0!==h||l<s)&&-1!==k;k--,l++)h+=a*f[k]>>>0,f[k]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");s=l,n++}if(" "!==e[n]){for(var b=o-s;b!==o&&0===f[b];)b++;var p=r.allocUnsafe(i+(o-b));p.fill(0,0,i);for(var d=i;b!==o;)p[d++]=f[b++];return p}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=r.from(t)),!r.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var n=0,i=0,s=0,o=t.length;s!==o&&0===t[s];)s++,n++;for(var c=(o-s)*f+1>>>0,h=new Uint8Array(c);s!==o;){for(var l=t[s],k=0,b=c-1;(0!==l||k<i)&&-1!==b;b--,k++)l+=256*h[b]>>>0,h[b]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");i=k,s++}for(var p=c-i;p!==c&&0===h[p];)p++;for(var d=u.repeat(n);p<c;++p)d+=e.charAt(h[p]);return d},decodeUnsafe:h,decode:function(e){var t=h(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},function(e,t,n){"use strict";var r=n(15),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";(function(e){var r=n(17),i=n(18),s=n(19);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=l(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|b(t,n),i=(e=a(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|k(t.length);return 0===(e=a(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?a(e,0):l(e,t);if("Buffer"===t.type&&s(t.data))return l(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(f(t),e=a(e,t<0?0:0|k(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function l(e,t){var n=t.length<0?0:0|k(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function k(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function b(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return L(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return S(this,t,n);case"base64":return U(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function d(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var s,o=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(s=n;s<a;s++)if(c(e,s)===c(t,-1===f?0:s-f)){if(-1===f&&(f=s),s-f+1===u)return f*o}else-1!==f&&(s-=s-f),f=-1}else for(n+u>a&&(n=a-u),s=n;s>=0;s--){for(var h=!0,l=0;l<u;l++)if(c(e,s+l)!==c(t,l)){h=!1;break}if(h)return s}return-1}function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[n+o]=a}return o}function m(e,t,n,r){return V(L(t,e.length-n),e,n,r)}function v(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return v(e,t,n,r)}function A(e,t,n,r){return V(z(t),e,n,r)}function x(e,t,n,r){return V(function(e,t){for(var n,r,i,s=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function U(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var s,o,a,u,c=e[i],f=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(f=c);break;case 2:128==(192&(s=e[i+1]))&&(u=(31&c)<<6|63&s)>127&&(f=u);break;case 3:s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(u=(15&c)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,h=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return f(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return h(null,e)},u.allocUnsafeSlow=function(e){return h(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,s=Math.min(n,r);i<s;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!s(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},u.byteLength=b,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):p.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),a=Math.min(s,o),c=this.slice(r,i),f=e.slice(t,n),h=0;h<a;++h)if(c[h]!==f[h]){s=c[h],o=f[h];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return m(this,e,t,n);case"ascii":return v(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function S(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=t;s<n;++s)i+=N(e[s]);return i}function C(e,t,n){for(var r=e.slice(t,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,i,s){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function I(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i<s;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function O(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i<s;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function D(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,s){return s||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,s){return s||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,s=0;++s<t&&(i*=256);)r+=this[e+s]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,s=0;++s<t&&(i*=256);)r+=this[e+s]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,s=this[e+--r];r>0&&(i*=256);)s+=this[e+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||B(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[t]=255&e;++s<n&&(i*=256);)this[t+s]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||B(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<n&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,s=r-n;if(this===e&&n<t&&t<r)for(i=s-1;i>=0;--i)e[i+t]=this[i+n];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var o=u.isBuffer(e)?e:L(new u(e,r).toString()),a=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%a]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function L(e,t){var n;t=t||1/0;for(var r=e.length,i=null,s=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(16))},function(e,t,n){"use strict";var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(i){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),o=r[0],a=r[1],u=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),f=0,h=a>0?o-4:o;for(n=0;n<h;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[f++]=255&t);1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=0,a=n-i;o<a;o+=16383)s.push(f(e,o,o+16383>a?a:o+16383));1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a<u;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function f(e,t,n){for(var i,s,o=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,n){"use strict";t.read=function(e,t,n,r,i){var s,o,a=8*i-r-1,u=(1<<a)-1,c=u>>1,f=-7,h=n?i-1:0,l=n?-1:1,k=e[t+h];for(h+=l,s=k&(1<<-f)-1,k>>=-f,f+=a;f>0;s=256*s+e[t+h],h+=l,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=r;f>0;o=256*o+e[t+h],h+=l,f-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(k?-1:1);o+=Math.pow(2,r),s-=c}return(k?-1:1)*o*Math.pow(2,s-r)},t.write=function(e,t,n,r,i,s){var o,a,u,c=8*s-i-1,f=(1<<c)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,k=r?0:s-1,b=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+h>=1?l/u:l*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=f?(a=0,o=f):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[n+k]=255&a,k+=b,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[n+k]=255&o,k+=b,o/=256,c-=8);e[n+k-b]|=128*p}},function(e,t,n){"use strict";var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,n){"use strict";const{encodeText:r}=n(2);e.exports=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=r(this.code),this.alphabet=i,this.engine=n(i)}encode(e){return this.engine.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.engine.decode(e)}}},function(e,t,n){"use strict";e.exports=e=>t=>({encode:n=>((e,t,n)=>{const r="="===t[t.length-1],i=(1<<n)-1;let s="",o=0,a=0;for(let u=0;u<e.length;++u)for(a=a<<8|e[u],o+=8;o>n;)o-=n,s+=t[i&a>>o];if(o&&(s+=t[i&a<<n-o]),r)for(;s.length*n&7;)s+="=";return s})(n,t,e),decode:n=>((e,t,n)=>{const r={};for(let c=0;c<t.length;++c)r[t[c]]=c;let i=e.length;for(;"="===e[i-1];)--i;const s=new Uint8Array(i*n/8|0);let o=0,a=0,u=0;for(let c=0;c<i;++c){const t=r[e[c]];if(void 0===t)throw new SyntaxError("Invalid character "+e[c]);a=a<<n|t,o+=n,o>=8&&(o-=8,s[u++]=255&a>>o)}if(o>=n||255&a<<8-o)throw new SyntaxError("Unexpected end of data");return s})(n,t,e)})},function(e,t,n){"use strict";e.exports=function e(t,n,i){n=n||[];var s=i=i||0;for(;t>=r;)n[i++]=255&t|128,t/=128;for(;-128&t;)n[i++]=255&t|128,t>>>=7;return n[i]=0|t,e.bytes=i-s+1,n};var r=Math.pow(2,31)},function(e,t,n){"use strict";e.exports=function e(t,n){var r,i=0,s=0,o=n=n||0,a=t.length;do{if(o>=a)throw e.bytes=0,new RangeError("Could not decode varint");r=t[o++],i+=s<28?(127&r)<<s:(127&r)*Math.pow(2,s),s+=7}while(r>=128);return e.bytes=o-n,i}},function(e,t,n){"use strict";var r=Math.pow(2,7),i=Math.pow(2,14),s=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),u=Math.pow(2,42),c=Math.pow(2,49),f=Math.pow(2,56),h=Math.pow(2,63);e.exports=function(e){return e<r?1:e<i?2:e<s?3:e<o?4:e<a?5:e<u?6:e<c?7:e<f?8:e<h?9:10}},function(e,t,n){"use strict";const r=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:r}},function(e,t,n){"use strict";const r=n(4),i=n(27),s=n(28),o=n(10),a=n(6);(t=e.exports).addPrefix=(e,t)=>{let n;if(e instanceof Uint8Array)n=o.varintUint8ArrayEncode(e);else{if(!s[e])throw new Error("multicodec not recognized");n=s[e]}return a([n,t],n.length+t.length)},t.rmPrefix=e=>(r.decode(e),e.slice(r.decode.bytes)),t.getCodec=e=>{const t=r.decode(e),n=i.get(t);if(void 0===n)throw new Error(`Code ${t} not found`);return n},t.getName=e=>i.get(e),t.getNumber=e=>{const t=s[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return o.varintUint8ArrayDecode(t)[0]},t.getCode=e=>r.decode(e),t.getCodeVarint=e=>{const t=s[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return t},t.getVarint=e=>r.encode(e);const u=n(29);Object.assign(t,u),t.print=n(30)},function(e,t,n){"use strict";const r=n(0),i=new Map;for(const s in r){const e=r[s];i.set(e,s)}e.exports=Object.freeze(i)},function(e,t,n){"use strict";const r=n(0),i=n(10).varintEncode,s={};for(const o in r){const e=r[o];s[o]=i(e)}e.exports=Object.freeze(s)},function(e,t,n){"use strict";const r=n(0),i={};for(const[s,o]of Object.entries(r))i[s.toUpperCase().replace(/-/g,"_")]=o;e.exports=Object.freeze(i)},function(e,t,n){"use strict";const r=n(0),i={};for(const[s,o]of Object.entries(r))void 0===i[o]&&(i[o]=s);e.exports=Object.freeze(i)},function(e,t,n){"use strict";const r=n(7),i={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!=typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{r.validate(e.multihash)}catch(t){let e=t.message;return e||(e="Multihash validation failed"),e}}};e.exports=i},function(e,t,n){"use strict";e.exports=function(e,{className:t,symbolName:n}){const r=Symbol.for(n),i={[t]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,r,{value:!0})}get[Symbol.toStringTag](){return t}}}[t];return i["is"+t]=e=>!(!e||!e[r]),i},e.exports.proto=function(e,{className:t,symbolName:n,withoutNew:r}){const i=Symbol.for(n),s={[t]:function(...t){if(r&&!(this instanceof s))return new s(...t);const n=e.call(this,...t)||this;return n&&!n[i]&&Object.defineProperty(n,i,{value:!0}),n}}[t];return s.prototype=Object.create(e.prototype),s.prototype.constructor=s,Object.defineProperty(s.prototype,Symbol.toStringTag,{get:()=>t}),s["is"+t]=e=>!(!e||!e[i]),s}},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}}])}));
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Cids=n():e.Cids=n()}(window,(function(){return function(e){var n={};function s(i){if(n[i])return n[i].exports;var t=n[i]={i:i,l:!1,exports:{}};return e[i].call(t.exports,t,t.exports,s),t.l=!0,t.exports}return s.m=e,s.c=n,s.d=function(e,n,i){s.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,n){if(1&n&&(e=s(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)s.d(i,t,function(n){return e[n]}.bind(null,t));return i},s.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(n,"a",n),n},s.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},s.p="",s(s.s=10)}([function(e,n,s){"use strict";const i=s(12),t=s(13),r=s(14),{decodeText:o,encodeText:k}=s(3),a=[["identity","\0",()=>({encode:o,decode:k}),""],["base2","0",r(1),"01"],["base8","7",r(3),"01234567"],["base10","9",i,"0123456789"],["base16","f",r(4),"0123456789abcdef"],["base16upper","F",r(4),"0123456789ABCDEF"],["base32hex","v",r(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",r(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",r(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",r(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",r(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",r(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",r(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",r(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",r(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",i,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",i,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",i,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",i,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",r(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",r(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",r(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",r(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=a.reduce((e,n)=>(e[n[0]]=new t(n[0],n[1],n[2],n[3]),e),{}),b=a.reduce((e,n)=>(e[n[1]]=c[n[0]],e),{});e.exports={names:c,codes:b}},function(e,n,s){"use strict";n.TextEncoder=TextEncoder,n.TextDecoder=TextDecoder},function(e){e.exports=JSON.parse('{"identity":0,"ip4":4,"tcp":6,"sha1":17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"blake3":30,"dccp":33,"murmur3-128":34,"murmur3-32":35,"ip6":41,"ip6zone":42,"path":47,"multicodec":48,"multihash":49,"multiaddr":50,"multibase":51,"dns":53,"dns4":54,"dns6":55,"dnsaddr":56,"protobuf":80,"cbor":81,"raw":85,"dbl-sha2-256":86,"rlp":96,"bencode":99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,"sctp":132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,"stellar-block":208,"stellar-tx":209,"md4":212,"md5":213,"bmt":214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,"zeronet":230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,"udp":273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,"udt":301,"utp":302,"unix":400,"p2p":421,"ipfs":421,"https":443,"onion":444,"onion3":445,"garlic64":446,"garlic32":447,"tls":448,"quic":460,"ws":477,"wss":478,"p2p-websocket-star":479,"http":480,"json":512,"messagepack":513,"libp2p-peer-record":769,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,"x11":4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46000,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332}')},function(e,n,s){"use strict";const{TextEncoder:i,TextDecoder:t}=s(1),r=new t,o=new i;e.exports={decodeText:e=>r.decode(e),encodeText:e=>o.encode(e),concat:function(e,n){const s=new Uint8Array(n);let i=0;for(const t of e)s.set(t,i),i+=t.length;return s}}},function(e,n,s){"use strict";e.exports={encode:s(15),decode:s(16),encodingLength:s(17)}},function(e,n,s){"use strict";const i=s(6),t=s(4),{names:r}=s(18),o=s(7),k=s(19),a=s(8),c={};for(const l in r)c[r[l]]=l;function b(e){n.decode(e)}n.names=r,n.codes=Object.freeze(c),n.toHexString=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(e,"base16")},n.fromHexString=function(e){return k(e,"base16")},n.toB58String=function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(i.encode("base58btc",e)).slice(1)},n.fromB58String=function(e){const n=e instanceof Uint8Array?o(e):e;return i.decode("z"+n)},n.decode=function(e){if(!(e instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const s=t.decode(e);if(!n.isValidCode(s))throw new Error("multihash unknown function code: 0x"+s.toString(16));e=e.slice(t.decode.bytes);const i=t.decode(e);if(i<0)throw new Error("multihash invalid length: "+i);if((e=e.slice(t.decode.bytes)).length!==i)throw new Error("multihash length inconsistent: 0x"+o(e,"base16"));return{code:s,name:c[s],length:i,digest:e}},n.encode=function(e,s,i){if(!e||void 0===s)throw new Error("multihash encode requires at least two args: digest, code");const r=n.coerceCode(s);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==i&&(i=e.length),i&&e.length!==i)throw new Error("digest length should be equal to specified length.");const o=t.encode(r),k=t.encode(i);return a([o,k,e],o.length+k.length+e.length)},n.coerceCode=function(e){let s=e;if("string"==typeof e){if(void 0===r[e])throw new Error("Unrecognized hash function named: "+e);s=r[e]}if("number"!=typeof s)throw new Error("Hash function code should be a number. Got: "+s);if(void 0===c[s]&&!n.isAppCode(s))throw new Error("Unrecognized function code: "+s);return s},n.isAppCode=function(e){return e>0&&e<16},n.isValidCode=function(e){return!!n.isAppCode(e)||!!c[e]},n.validate=b,n.prefix=function(e){return b(e),e.subarray(0,2)}},function(e,n,s){"use strict";const i=s(0),{encodeText:t,decodeText:r,concat:o}=s(3);function k(e){if(i.names[e])return i.names[e];if(i.codes[e])return i.codes[e];throw new Error("Unsupported encoding: "+e)}(n=e.exports=function(e,n){if(!n)throw new Error("requires an encoded Uint8Array");const{name:s,codeBuf:i}=k(e);return function(e,n){k(e).decode(r(n))}(s,n),o([i,n],i.length+n.length)}).encode=function(e,n){const s=k(e),i=t(s.encode(n));return o([s.codeBuf,i],s.codeBuf.length+i.length)},n.decode=function(e){e instanceof Uint8Array&&(e=r(e));const n=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(n)&&(e=e.toLowerCase()),k(e[0]).decode(e.substring(1))},n.isEncoded=function(e){if(e instanceof Uint8Array&&(e=r(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return k(e[0]).name}catch(n){return!1}},n.encoding=k,n.encodingFromData=function(e){return e instanceof Uint8Array&&(e=r(e)),k(e[0])},n.names=Object.freeze(i.names),n.codes=Object.freeze(i.codes)},function(e,n,s){"use strict";const{names:i}=s(0),{TextDecoder:t}=s(1),r=new t("utf8");e.exports=function(e,n="utf8"){if("utf8"===n||"utf-8"===n)return r.decode(e);if("ascii"===n)return function(e){let n="";for(let s=0;s<e.length;s++)n+=String.fromCharCode(e[s]);return n}(e);const s=i[n];if(!s)throw new Error("Unknown base");return s.encode(e)}},function(e,n,s){"use strict";e.exports=function(e,n){n||(n=e.reduce((e,n)=>e+n.length,0));const s=new Uint8Array(n);let i=0;for(const t of e)s.set(t,i),i+=t.length;return s}},function(e,n,s){"use strict";const i=s(4),t=s(23),r=s(24);function o(e){return parseInt(t(e,"base16"),16)}e.exports={numberToUint8Array:function(e){let n=e.toString(16);n.length%2==1&&(n="0"+n);return r(n,"base16")},uint8ArrayToNumber:o,varintUint8ArrayEncode:function(e){return Uint8Array.from(i.encode(o(e)))},varintEncode:function(e){return Uint8Array.from(i.encode(e))}}},function(e,n,s){e.exports=s(11)},function(e,n,s){"use strict";const i=s(5),t=s(6),r=s(20),o=s(2),k=s(28),a=s(29),c=s(8),b=s(7),l=s(30),u=Object.keys(o).reduce((e,n)=>(e[o[n]]=n,e),{});class d{constructor(e,n,s,o){if(h.isCID(e)){const n=e;return this.version=n.version,this.codec=n.codec,this.multihash=n.multihash,void(this.multibaseName=n.multibaseName||(0===n.version?"base58btc":"base32"))}if("string"==typeof e){const n=t.isEncoded(e);if(n){const s=t.decode(e);this.version=parseInt(s.slice(0,1).toString("hex"),16),this.codec=r.getCodec(s.slice(1)),this.multihash=r.rmPrefix(s.slice(1)),this.multibaseName=n}else this.version=0,this.codec="dag-pb",this.multihash=i.fromB58String(e),this.multibaseName="base58btc";return d.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){const n=e.slice(0,1),s=parseInt(n.toString("hex"),16);if(1===s){const n=e;this.version=s,this.codec=r.getCodec(n.slice(1)),this.multihash=r.rmPrefix(n.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";d.validateCID(this)}else this.version=e,"number"==typeof n&&(n=u[n]),this.codec=n,this.multihash=s,this.multibaseName=o||(0===e?"base58btc":"base32"),d.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");{const n=r.getCodeVarint(this.codec);e=c([[1],n,this.multihash],1+n.byteLength+this.multihash.byteLength)}}Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){const e=r.getCodeVarint(this.codec),n=i.prefix(this.multihash);return c([[this.version],e,n],1+e.byteLength+n.byteLength)}get code(){return o[this.codec]}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:n}=i.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==n)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new h(0,this.codec,this.multihash)}toV1(){return new h(1,this.codec,this.multihash)}toBaseEncodedString(e=this.multibaseName){if(this.string&&e===this.multibaseName)return this.string;let n=null;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");n=i.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");n=b(t.encode(e,this.bytes))}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:n}),n}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&l(this.multihash,e.multihash)}static validateCID(e){const n=k.checkCIDComponents(e);if(n)throw new Error(n)}}const h=a(d,{className:"CID",symbolName:"@ipld/js-cid/CID"});h.codecs=o,e.exports=h},function(e,n,s){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),s=0;s<n.length;s++)n[s]=255;for(var i=0;i<e.length;i++){var t=e.charAt(i),r=t.charCodeAt(0);if(255!==n[r])throw new TypeError(t+" is ambiguous");n[r]=i}var o=e.length,k=e.charAt(0),a=Math.log(o)/Math.log(256),c=Math.log(256)/Math.log(o);function b(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var s=0;if(" "!==e[s]){for(var i=0,t=0;e[s]===k;)i++,s++;for(var r=(e.length-s)*a+1>>>0,c=new Uint8Array(r);e[s];){var b=n[e.charCodeAt(s)];if(255===b)return;for(var l=0,u=r-1;(0!==b||l<t)&&-1!==u;u--,l++)b+=o*c[u]>>>0,c[u]=b%256>>>0,b=b/256>>>0;if(0!==b)throw new Error("Non-zero carry");t=l,s++}if(" "!==e[s]){for(var d=r-t;d!==r&&0===c[d];)d++;for(var h=new Uint8Array(i+(r-d)),f=i;d!==r;)h[f++]=c[d++];return h}}}return{encode:function(n){if(n instanceof Uint8Array||(ArrayBuffer.isView(n)?n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength):Array.isArray(n)&&(n=Uint8Array.from(n))),!(n instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===n.length)return"";for(var s=0,i=0,t=0,r=n.length;t!==r&&0===n[t];)t++,s++;for(var a=(r-t)*c+1>>>0,b=new Uint8Array(a);t!==r;){for(var l=n[t],u=0,d=a-1;(0!==l||u<i)&&-1!==d;d--,u++)l+=256*b[d]>>>0,b[d]=l%o>>>0,l=l/o>>>0;if(0!==l)throw new Error("Non-zero carry");i=u,t++}for(var h=a-i;h!==a&&0===b[h];)h++;for(var f=k.repeat(s);h<a;++h)f+=e.charAt(b[h]);return f},decodeUnsafe:b,decode:function(e){var n=b(e);if(n)return n;throw new Error("Non-base"+o+" character")}}}},function(e,n,s){"use strict";const{encodeText:i}=s(3);e.exports=class{constructor(e,n,s,t){this.name=e,this.code=n,this.codeBuf=i(this.code),this.alphabet=t,this.engine=s(t)}encode(e){return this.engine.encode(e)}decode(e){for(const n of e)if(this.alphabet&&this.alphabet.indexOf(n)<0)throw new Error(`invalid character '${n}' in '${e}'`);return this.engine.decode(e)}}},function(e,n,s){"use strict";e.exports=e=>n=>({encode:s=>((e,n,s)=>{const i="="===n[n.length-1],t=(1<<s)-1;let r="",o=0,k=0;for(let a=0;a<e.length;++a)for(k=k<<8|e[a],o+=8;o>s;)o-=s,r+=n[t&k>>o];if(o&&(r+=n[t&k<<s-o]),i)for(;r.length*s&7;)r+="=";return r})(s,n,e),decode:s=>((e,n,s)=>{const i={};for(let c=0;c<n.length;++c)i[n[c]]=c;let t=e.length;for(;"="===e[t-1];)--t;const r=new Uint8Array(t*s/8|0);let o=0,k=0,a=0;for(let c=0;c<t;++c){const n=i[e[c]];if(void 0===n)throw new SyntaxError("Invalid character "+e[c]);k=k<<s|n,o+=s,o>=8&&(o-=8,r[a++]=255&k>>o)}if(o>=s||255&k<<8-o)throw new SyntaxError("Unexpected end of data");return r})(s,n,e)})},function(e,n,s){"use strict";e.exports=function e(n,s,t){s=s||[];var r=t=t||0;for(;n>=i;)s[t++]=255&n|128,n/=128;for(;-128&n;)s[t++]=255&n|128,n>>>=7;return s[t]=0|n,e.bytes=t-r+1,s};var i=Math.pow(2,31)},function(e,n,s){"use strict";e.exports=function e(n,s){var i,t=0,r=0,o=s=s||0,k=n.length;do{if(o>=k)throw e.bytes=0,new RangeError("Could not decode varint");i=n[o++],t+=r<28?(127&i)<<r:(127&i)*Math.pow(2,r),r+=7}while(i>=128);return e.bytes=o-s,t}},function(e,n,s){"use strict";var i=Math.pow(2,7),t=Math.pow(2,14),r=Math.pow(2,21),o=Math.pow(2,28),k=Math.pow(2,35),a=Math.pow(2,42),c=Math.pow(2,49),b=Math.pow(2,56),l=Math.pow(2,63);e.exports=function(e){return e<i?1:e<t?2:e<r?3:e<o?4:e<k?5:e<a?6:e<c?7:e<b?8:e<l?9:10}},function(e,n,s){"use strict";const i=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});e.exports={names:i}},function(e,n,s){"use strict";const{names:i}=s(0),{TextEncoder:t}=s(1),r=new t;e.exports=function(e,n="utf8"){if("utf8"===n||"utf-8"===n)return r.encode(e);if("ascii"===n)return function(e){const n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return n}(e);const s=i[n];if(!s)throw new Error("Unknown base");return s.decode(e)}},function(e,n,s){"use strict";const i=s(4),t=s(21),r=s(22),o=s(9),k=s(25);(n=e.exports).addPrefix=(e,n)=>{let s;if(e instanceof Uint8Array)s=o.varintUint8ArrayEncode(e);else{if(!r[e])throw new Error("multicodec not recognized");s=r[e]}return k([s,n],s.length+n.length)},n.rmPrefix=e=>(i.decode(e),e.slice(i.decode.bytes)),n.getCodec=e=>{const n=i.decode(e),s=t.get(n);if(void 0===s)throw new Error(`Code ${n} not found`);return s},n.getName=e=>t.get(e),n.getNumber=e=>{const n=r[e];if(void 0===n)throw new Error("Codec `"+e+"` not found");return i.decode(n)},n.getCode=e=>i.decode(e),n.getCodeVarint=e=>{const n=r[e];if(void 0===n)throw new Error("Codec `"+e+"` not found");return n},n.getVarint=e=>i.encode(e);const a=s(26);Object.assign(n,a),n.print=s(27)},function(e,n,s){"use strict";const i=s(2),t=new Map;for(const r in i){const e=i[r];t.set(e,r)}e.exports=Object.freeze(t)},function(e,n,s){"use strict";const i=s(2),t=s(9).varintEncode,r={};for(const o in i){const e=i[o];r[o]=t(e)}e.exports=Object.freeze(r)},function(e,n,s){"use strict";const{names:i}=s(0),{TextDecoder:t}=s(1),r=new t("utf8");e.exports=function(e,n="utf8"){if("utf8"===n||"utf-8"===n)return r.decode(e);const s=i[n];if(!s)throw new Error("Unknown base");return s.encode(e)}},function(e,n,s){"use strict";const{names:i}=s(0),{TextEncoder:t}=s(1),r=new t;e.exports=function(e,n="utf8"){if("utf8"===n||"utf-8"===n)return r.encode(e);const s=i[n];if(!s)throw new Error("Unknown base");return s.decode(e)}},function(e,n,s){"use strict";e.exports=function(e,n){n||(n=e.reduce((e,n)=>e+n.length,0));const s=new Uint8Array(n);let i=0;for(const t of e)s.set(t,i),i+=t.length;return s}},function(e,n,s){"use strict";const i=s(2),t={};for(const[r,o]of Object.entries(i))t[r.toUpperCase().replace(/-/g,"_")]=o;e.exports=Object.freeze(t)},function(e,n,s){"use strict";const i=s(2),t={};for(const[r,o]of Object.entries(i))void 0===t[o]&&(t[o]=r);e.exports=Object.freeze(t)},function(e,n,s){"use strict";const i=s(5),t={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!=typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{i.validate(e.multihash)}catch(n){let e=n.message;return e||(e="Multihash validation failed"),e}}};e.exports=t},function(e,n,s){"use strict";e.exports=function(e,{className:n,symbolName:s}){const i=Symbol.for(s),t={[n]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,i,{value:!0})}get[Symbol.toStringTag](){return n}}}[n];return t["is"+n]=e=>!(!e||!e[i]),t},e.exports.proto=function(e,{className:n,symbolName:s,withoutNew:i}){const t=Symbol.for(s),r={[n]:function(...n){if(i&&!(this instanceof r))return new r(...n);const s=e.call(this,...n)||this;return s&&!s[t]&&Object.defineProperty(s,t,{value:!0}),s}}[n];return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,Object.defineProperty(r.prototype,Symbol.toStringTag,{get:()=>n}),r["is"+n]=e=>!(!e||!e[t]),r}},function(e,n,s){"use strict";e.exports=function(e,n){if(e===n)return!0;if(e.byteLength!==n.byteLength)return!1;for(let s=0;s<e.byteLength;s++)if(e[s]!==n[s])return!1;return!0}}])}));
{
"name": "cids",
"version": "1.0.0",
"version": "1.0.1",
"description": "CID Implementation in JavaScript",

@@ -39,10 +39,10 @@ "leadMaintainer": "Volker Mische <volker.mische@gmail.com>",

"class-is": "^1.1.0",
"multibase": "^3.0.0",
"multicodec": "^2.0.0",
"multibase": "^3.0.1",
"multicodec": "^2.0.1",
"multihashes": "^3.0.1",
"uint8arrays": "^1.0.0"
"uint8arrays": "^1.1.0"
},
"devDependencies": {
"aegir": "^25.0.0",
"multihashing-async": "^2.0.0"
"aegir": "^26.0.0",
"multihashing-async": "^2.0.1"
},

@@ -49,0 +49,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc