{"_id":"uint8array-extras","_rev":"4082501","name":"uint8array-extras","description":"Useful utilities for working with Uint8Array (and Buffer)","dist-tags":{"latest":"1.5.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2025-11-24T21:40:09.000Z","created":"2023-10-24T05:59:15.320Z","1.5.0":"2025-08-22T06:17:25.662Z","1.4.1":"2025-08-12T06:39:18.482Z","1.4.0":"2024-07-16T19:18:11.238Z","1.3.0":"2024-07-05T13:05:44.656Z","1.2.0":"2024-06-29T13:23:07.266Z","1.1.0":"2024-01-06T22:11:33.052Z","1.0.0":"2023-12-08T01:52:53.239Z","0.5.1":"2023-11-08T15:39:17.010Z","0.5.0":"2023-10-29T07:13:27.193Z","0.4.0":"2023-10-27T07:50:52.271Z","0.3.0":"2023-10-24T19:35:18.709Z","0.2.0":"2023-10-24T12:59:35.422Z","0.1.0":"2023-10-24T05:59:15.320Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"versions":{"1.5.0":{"name":"uint8array-extras","version":"1.5.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^6.0.1","typescript":"^5.3.3","xo":"^0.56.0","benchmark":"2.1.4"},"_id":"uint8array-extras@1.5.0","gitHead":"033df7fe8d2d0f196ee0ec9110662cb97005ce30","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"shasum":"10d2a85213de3ada304fea1c454f635c73839e86","size":6397,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-1.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-1.5.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uint8array-extras_1.5.0_1755843445473_0.19279572565826086"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-22T06:17:25.662Z","publish_time":1755843445662,"_source_registry_name":"default","_cnpm_publish_time":1755843445662},"1.4.1":{"name":"uint8array-extras","version":"1.4.1","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^6.0.1","typescript":"^5.3.3","xo":"^0.56.0","benchmark":"2.1.4"},"_id":"uint8array-extras@1.4.1","gitHead":"c3b4ff1c7909271ef887c4251f63d7dd4e796dc9","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"shasum":"6d6e88363a414577c133aca1e63b2a6c5524be21","size":6192,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-1.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-1.4.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uint8array-extras_1.4.1_1754980758300_0.3161858972437377"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-12T06:39:18.482Z","publish_time":1754980758482,"_source_registry_name":"default","_cnpm_publish_time":1754980758482},"1.4.0":{"name":"uint8array-extras","version":"1.4.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^6.0.1","typescript":"^5.3.3","xo":"^0.56.0","benchmark":"2.1.4"},"_id":"uint8array-extras@1.4.0","gitHead":"733444ac8059552cdc48acf0ad0c8fc902f95431","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"shasum":"e42a678a6dd335ec2d21661333ed42f44ae7cc74","size":6188,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-1.4.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_1.4.0_1721157491091_0.2704972148890763"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-16T19:18:11.238Z","publish_time":1721157491238,"_source_registry_name":"default","_cnpm_publish_time":1721157491238},"1.3.0":{"name":"uint8array-extras","version":"1.3.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^6.0.1","typescript":"^5.3.3","xo":"^0.56.0","benchmark":"2.1.4"},"_id":"uint8array-extras@1.3.0","gitHead":"7dad071c3fe1bcb59d437494af18c3ae3fa567e1","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"shasum":"0b2e511cfdd91e00b8f011ba6b850d7671f36fa2","size":6086,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-1.3.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_1.3.0_1720184744505_0.757101264592944"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-05T13:05:44.656Z","publish_time":1720184744656,"_source_registry_name":"default","_cnpm_publish_time":1720184744656},"1.2.0":{"name":"uint8array-extras","version":"1.2.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^6.0.1","typescript":"^5.3.3","xo":"^0.56.0","benchmark":"2.1.4"},"_id":"uint8array-extras@1.2.0","gitHead":"7fb099cbdda8794ff06ae582f97f548cd9d6a333","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_nodeVersion":"20.12.2","_npmVersion":"10.6.0","dist":{"shasum":"36a3138ba2d1c0bce9ab824f6f16bc783c20118f","size":5966,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-1.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_1.2.0_1719667387121_0.8429327215664053"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-29T13:23:07.266Z","publish_time":1719667387266,"_source_registry_name":"default","maintainers":[{"name":"sindresorhus","email":""}],"_cnpm_publish_time":1719667387266},"1.1.0":{"name":"uint8array-extras","version":"1.1.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^6.0.1","typescript":"^5.3.3","xo":"^0.56.0","benchmark":"2.1.4"},"types":"./index.d.ts","gitHead":"7b6fe3b61f793fecf8ebded4770d948e53470603","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@1.1.0","_nodeVersion":"21.5.0","_npmVersion":"9.2.0","dist":{"shasum":"a67fec15f756d78a3c93c6f07c4fae4335f95d9c","size":5029,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-1.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_1.1.0_1704579092832_0.1926944974018039"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-06T22:11:33.052Z","publish_time":1704579093052,"_source_registry_name":"default","_cnpm_publish_time":1704579093052},"1.0.0":{"name":"uint8array-extras","version":"1.0.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^6.0.1","typescript":"^5.3.3","xo":"^0.56.0","benchmark":"2.1.4"},"types":"./index.d.ts","gitHead":"b25ac06cf247c27c5e80353a033266357c05d9d2","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@1.0.0","_nodeVersion":"18.19.0","_npmVersion":"9.2.0","dist":{"shasum":"88bced99bc5067ee61f7b909605850cb306b96f1","size":5028,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-1.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_1.0.0_1702000373032_0.9284790262605414"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-08T01:52:53.239Z","publish_time":1702000373239,"_source_registry_name":"default","_cnpm_publish_time":1702000373239},"0.5.1":{"name":"uint8array-extras","version":"0.5.1","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^5.3.1","typescript":"^5.2.2","xo":"^0.56.0","benchmark":"2.1.4"},"types":"./index.d.ts","gitHead":"24f692da1f55de48ccb7334ab4fc79e1c2af0f0f","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@0.5.1","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"shasum":"cf78cc896c177f90f59525ef09da7670ae13032a","size":4995,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-0.5.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_0.5.1_1699457956864_0.0418785332139624"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-08T15:39:17.010Z","publish_time":1699457957010,"_source_registry_name":"default","_cnpm_publish_time":1699457957010},"0.5.0":{"name":"uint8array-extras","version":"0.5.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"sideEffects":false,"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^5.3.1","typescript":"^5.2.2","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"fd1bccba32d81eb9b64ad51f8e5de37f0edf73a6","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@0.5.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"6b997348064a46609adb13412f155bfce9830c30","size":4773,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-0.5.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_0.5.0_1698563607016_0.32739327037052357"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-29T07:13:27.193Z","publish_time":1698563607193,"_source_registry_name":"default","_cnpm_publish_time":1698563607193},"0.4.0":{"name":"uint8array-extras","version":"0.4.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"sideEffects":false,"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^5.3.1","typescript":"^5.2.2","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"f1db6fafe49eb3bd3ab7d0d620a076740526fd4c","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@0.4.0","_nodeVersion":"18.17.1","_npmVersion":"9.2.0","dist":{"shasum":"11fc06f05f4381b635b3b599670b80ba171e0f03","size":4383,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-0.4.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_0.4.0_1698393052105_0.38505337870386236"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-27T07:50:52.271Z","publish_time":1698393052271,"_source_registry_name":"default","_cnpm_publish_time":1698393052271},"0.3.0":{"name":"uint8array-extras","version":"0.3.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"sideEffects":false,"scripts":{"test":"xo && ava"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa","hex","hexadecimal"],"devDependencies":{"ava":"^5.3.1","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"a9095b09d9250a51658d11e50053318c209eac35","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@0.3.0","_nodeVersion":"20.5.0","_npmVersion":"9.2.0","dist":{"shasum":"4b5714e4bf15bb36ae7fd6faeef11aae34a0af59","size":4170,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-0.3.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_0.3.0_1698176118485_0.2313117904377242"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-24T19:35:18.709Z","publish_time":1698176118709,"_source_registry_name":"default","_cnpm_publish_time":1698176118709},"0.2.0":{"name":"uint8array-extras","version":"0.2.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"sideEffects":false,"scripts":{"test":"xo && ava"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare","base64","string","atob","btoa"],"devDependencies":{"ava":"^5.3.1","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"cbf24e6e3c1884655452612b2cc5f266915a8df5","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@0.2.0","_nodeVersion":"20.5.0","_npmVersion":"9.2.0","dist":{"shasum":"94478ed50409b127debea41828a836159cc7bb46","size":3405,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-0.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_0.2.0_1698152375265_0.0809700178597792"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-24T12:59:35.422Z","publish_time":1698152375422,"_source_registry_name":"default","_cnpm_publish_time":1698152375422},"0.1.0":{"name":"uint8array-extras","version":"0.1.0","description":"Useful utilities for working with Uint8Array (and Buffer)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/uint8array-extras.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"sideEffects":false,"scripts":{"test":"xo && ava"},"keywords":["uint8array","uint8","typedarray","buffer","typedarray","arraybuffer","is","assert","concat","equals","compare"],"devDependencies":{"ava":"^5.3.1","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"66e19c7a758df0272dcdcb42bf2051f5f98a59e2","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","_id":"uint8array-extras@0.1.0","_nodeVersion":"18.17.1","_npmVersion":"9.2.0","dist":{"shasum":"809e205c648e6eea3299592e3bbcb1ee21a8a6e8","size":2719,"noattachment":false,"key":"/uint8array-extras/-/uint8array-extras-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/uint8array-extras/download/uint8array-extras-0.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/uint8array-extras_0.1.0_1698127155036_0.8364470401066821"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-24T05:59:15.320Z","publish_time":1698127155320,"_source_registry_name":"default","_cnpm_publish_time":1698127155320}},"readme":"# uint8array-extras\n\n> Useful utilities for working with [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) (and [`Buffer`](https://nodejs.org/api/buffer.html))\n\nIt's time to [transition from `Buffer` to `Uint8Array`](https://sindresorhus.com/blog/goodbye-nodejs-buffer), and this package helps fill in the gaps.\n\nNote that `Buffer` is a `Uint8Array` subclass, so you can use this package with `Buffer` too.\n\nThis package is tree-shakeable and browser-compatible.\n\nThis package also includes methods to convert a string to Base64 and back.\n\nNote: In the browser, do not use [`globalThis.atob()`](https://developer.mozilla.org/en-US/docs/Web/API/atob) / [`globalThis.btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/btoa) because they [do not support Unicode](https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem). This package does.\n\n## Install\n\n```sh\nnpm install uint8array-extras\n```\n\n## Usage\n\n```js\nimport {concatUint8Arrays} from 'uint8array-extras';\n\nconst a = new Uint8Array([1, 2, 3]);\nconst b = new Uint8Array([4, 5, 6]);\n\nconsole.log(concatUint8Arrays([a, b]));\n//=> Uint8Array [1, 2, 3, 4, 5, 6]\n```\n\n## API\n\n### `isUint8Array(value: unknown): boolean`\n\nCheck if the given value is an instance of `Uint8Array`.\n\nReplacement for [`Buffer.isBuffer()`](https://nodejs.org/api/buffer.html#static-method-bufferisbufferobj).\n\n```js\nimport {isUint8Array} from 'uint8array-extras';\n\nconsole.log(isUint8Array(new Uint8Array()));\n//=> true\n\nconsole.log(isUint8Array(Buffer.from('x')));\n//=> true\n\nconsole.log(isUint8Array(new ArrayBuffer(10)));\n//=> false\n```\n\n### `assertUint8Array(value: unknown)`\n\nThrow a `TypeError` if the given value is not an instance of `Uint8Array`.\n\n```js\nimport {assertUint8Array} from 'uint8array-extras';\n\ntry {\n\tassertUint8Array(new ArrayBuffer(10)); // Throws a TypeError\n} catch (error) {\n\tconsole.error(error.message);\n}\n```\n\n### `assertUint8ArrayOrArrayBuffer(value: unknown)`\n\nThrow a `TypeError` if the given value is not an instance of `Uint8Array` or `ArrayBuffer`.\n\nUseful as a guard for functions that accept either a `Uint8Array` or `ArrayBuffer`.\n\n```js\nimport {assertUint8ArrayOrArrayBuffer} from 'uint8array-extras';\n\nassertUint8ArrayOrArrayBuffer(new Uint8Array());\nassertUint8ArrayOrArrayBuffer(new ArrayBuffer(8));\n```\n\n### `toUint8Array(value: TypedArray | ArrayBuffer | DataView): Uint8Array`\n\nConvert a value to a `Uint8Array` without copying its data.\n\nThis can be useful for converting a `Buffer` to a pure `Uint8Array`. `Buffer` is already a `Uint8Array` subclass, but [`Buffer` alters some behavior](https://sindresorhus.com/blog/goodbye-nodejs-buffer), so it can be useful to cast it to a pure `Uint8Array` before returning it.\n\nTip: If you want a copy, just call `.slice()` on the return value.\n\n### `concatUint8Arrays(arrays: Uint8Array[], totalLength?: number): Uint8Array`\n\nConcatenate the given arrays into a new array.\n\nIf `arrays` is empty, it will return a zero-sized `Uint8Array`.\n\nIf `totalLength` is not specified, it is calculated from summing the lengths of the given arrays.\n\nReplacement for [`Buffer.concat()`](https://nodejs.org/api/buffer.html#static-method-bufferconcatlist-totallength).\n\n```js\nimport {concatUint8Arrays} from 'uint8array-extras';\n\nconst a = new Uint8Array([1, 2, 3]);\nconst b = new Uint8Array([4, 5, 6]);\n\nconsole.log(concatUint8Arrays([a, b]));\n//=> Uint8Array [1, 2, 3, 4, 5, 6]\n```\n\n### `areUint8ArraysEqual(a: Uint8Array, b: Uint8Array): boolean`\n\nCheck if two arrays are identical by verifying that they contain the same bytes in the same sequence.\n\nReplacement for [`Buffer#equals()`](https://nodejs.org/api/buffer.html#bufequalsotherbuffer).\n\n```js\nimport {areUint8ArraysEqual} from 'uint8array-extras';\n\nconst a = new Uint8Array([1, 2, 3]);\nconst b = new Uint8Array([1, 2, 3]);\nconst c = new Uint8Array([4, 5, 6]);\n\nconsole.log(areUint8ArraysEqual(a, b));\n//=> true\n\nconsole.log(areUint8ArraysEqual(a, c));\n//=> false\n```\n\n### `compareUint8Arrays(a: Uint8Array, b: Uint8Array): 0 | 1 | -1`\n\nCompare two arrays and indicate their relative order or equality. Useful for sorting.\n\nReplacement for [`Buffer.compare()`](https://nodejs.org/api/buffer.html#static-method-buffercomparebuf1-buf2).\n\n```js\nimport {compareUint8Arrays} from 'uint8array-extras';\n\nconst array1 = new Uint8Array([1, 2, 3]);\nconst array2 = new Uint8Array([4, 5, 6]);\nconst array3 = new Uint8Array([7, 8, 9]);\n\n[array3, array1, array2].sort(compareUint8Arrays);\n//=> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\n```\n\n### `uint8ArrayToString(array: Uint8Array | ArrayBuffer, encoding?: string = 'utf8'): string`\n\nConvert a `Uint8Array` to a string.\n\n- Parameter: `encoding` - The [encoding](https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API/Encodings) to convert from.\n\nReplacement for [`Buffer#toString()`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end). For the `encoding` parameter, `latin1` should be used instead of `binary` and `utf-16le` instead of `utf16le`.\n\n```js\nimport {uint8ArrayToString} from 'uint8array-extras';\n\nconst byteArray = new Uint8Array([72, 101, 108, 108, 111]);\nconsole.log(uint8ArrayToString(byteArray));\n//=> 'Hello'\n\nconst zh = new Uint8Array([167, 65, 166, 110]);\nconsole.log(uint8ArrayToString(zh, 'big5'));\n//=> '你好'\n\nconst ja = new Uint8Array([130, 177, 130, 241, 130, 201, 130, 191, 130, 205]);\nconsole.log(uint8ArrayToString(ja, 'shift-jis'));\n//=> 'こんにちは'\n```\n\n### `stringToUint8Array(string: string): Uint8Array`\n\nConvert a string to a `Uint8Array` (using UTF-8 encoding).\n\nReplacement for [`Buffer.from('Hello')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).\n\n```js\nimport {stringToUint8Array} from 'uint8array-extras';\n\nconsole.log(stringToUint8Array('Hello'));\n//=> Uint8Array [72, 101, 108, 108, 111]\n```\n\n### `uint8ArrayToBase64(array: Uint8Array, options?: {urlSafe: boolean}): string`\n\nConvert a `Uint8Array` to a Base64-encoded string.\n\nSpecify `{urlSafe: true}` to get a [Base64URL](https://base64.guru/standards/base64url)-encoded string.\n\nReplacement for [`Buffer#toString('base64')`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end).\n\n```js\nimport {uint8ArrayToBase64} from 'uint8array-extras';\n\nconst byteArray = new Uint8Array([72, 101, 108, 108, 111]);\n\nconsole.log(uint8ArrayToBase64(byteArray));\n//=> 'SGVsbG8='\n```\n\n### `base64ToUint8Array(string: string): Uint8Array`\n\nConvert a Base64-encoded or [Base64URL](https://base64.guru/standards/base64url)-encoded string to a `Uint8Array`.\n\nAccepts Base64URL with or without padding.\n\nReplacement for [`Buffer.from('SGVsbG8=', 'base64')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).\n\n```js\nimport {base64ToUint8Array} from 'uint8array-extras';\n\nconsole.log(base64ToUint8Array('SGVsbG8='));\n//=> Uint8Array [72, 101, 108, 108, 111]\n```\n\n### `stringToBase64(string: string, options?: {urlSafe: boolean}): string`\n\nEncode a string to a Base64-encoded string.\n\nSpecify `{urlSafe: true}` to get a [Base64URL](https://base64.guru/standards/base64url)-encoded string.\n\nReplacement for `Buffer.from('Hello').toString('base64')` and [`btoa()`](https://developer.mozilla.org/en-US/docs/Web/API/btoa).\n\n```js\nimport {stringToBase64} from 'uint8array-extras';\n\nconsole.log(stringToBase64('Hello'));\n//=> 'SGVsbG8='\n```\n\n### `base64ToString(base64String: string): string`\n\nDecode a Base64-encoded or [Base64URL](https://base64.guru/standards/base64url)-encoded string to a string.\n\nAccepts Base64URL with or without padding.\n\nReplacement for `Buffer.from('SGVsbG8=', 'base64').toString()` and [`atob()`](https://developer.mozilla.org/en-US/docs/Web/API/atob).\n\n```js\nimport {base64ToString} from 'uint8array-extras';\n\nconsole.log(base64ToString('SGVsbG8='));\n//=> 'Hello'\n```\n\n### `uint8ArrayToHex(array: Uint8Array): string`\n\nConvert a `Uint8Array` to a Hex string.\n\nReplacement for [`Buffer#toString('hex')`](https://nodejs.org/api/buffer.html#buftostringencoding-start-end).\n\n```js\nimport {uint8ArrayToHex} from 'uint8array-extras';\n\nconst byteArray = new Uint8Array([72, 101, 108, 108, 111]);\n\nconsole.log(uint8ArrayToHex(byteArray));\n//=> '48656c6c6f'\n```\n\n### `hexToUint8Array(hexString: string): Uint8Array`\n\nConvert a Hex string to a `Uint8Array`.\n\nReplacement for [`Buffer.from('48656c6c6f', 'hex')`](https://nodejs.org/api/buffer.html#static-method-bufferfromstring-encoding).\n\n```js\nimport {hexToUint8Array} from 'uint8array-extras';\n\nconsole.log(hexToUint8Array('48656c6c6f'));\n//=> Uint8Array [72, 101, 108, 108, 111]\n```\n\n### `getUintBE(view: DataView): number`\n\nRead `DataView#byteLength` number of bytes from the given view, up to 48-bit.\n\nReplacement for [`Buffer#readUIntBE`](https://nodejs.org/api/buffer.html#bufreaduintbeoffset-bytelength)\n\n```js\nimport {getUintBE} from 'uint8array-extras';\n\nconst byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(getUintBE(new DataView(byteArray.buffer)));\n//=> 20015998341291\n```\n\n### `indexOf(array: Uint8Array, value: Uint8Array): number`\n\nFind the index of the first occurrence of the given sequence of bytes (`value`) within the given `Uint8Array` (`array`).\n\nReplacement for [`Buffer#indexOf`](https://nodejs.org/api/buffer.html#bufindexofvalue-byteoffset-encoding). `Uint8Array#indexOf` only takes a number which is different from Buffer's `indexOf` implementation.\n\n```js\nimport {indexOf} from 'uint8array-extras';\n\nconst byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]);\n\nconsole.log(indexOf(byteArray, new Uint8Array([0x78, 0x90])));\n//=> 3\n```\n\n### `includes(array: Uint8Array, value: Uint8Array): boolean`\n\nChecks if the given sequence of bytes (`value`) is within the given `Uint8Array` (`array`).\n\nReturns true if the value is included, otherwise false.\n\nReplacement for [`Buffer#includes`](https://nodejs.org/api/buffer.html#bufincludesvalue-byteoffset-encoding). `Uint8Array#includes` only takes a number which is different from Buffer's `includes` implementation.\n\n```js\nimport {includes} from 'uint8array-extras';\n\nconst byteArray = new Uint8Array([0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]);\n\nconsole.log(includes(byteArray, new Uint8Array([0x78, 0x90])));\n//=> true\n```\n","_attachments":{},"homepage":"https://github.com/sindresorhus/uint8array-extras#readme","bugs":{"url":"https://github.com/sindresorhus/uint8array-extras/issues"},"license":"MIT"}