@ryniaubenpm/sunt-debitis-nihil 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ yarnPath: .yarn/releases/yarn-4.1.1.cjs
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 ReWiki
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,410 @@
1
+ # buffer [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
2
+
3
+ [ci-image]: https://img.shields.io/github/workflow/status/ryniaubenpm/sunt-debitis-nihil/ci/master
4
+ [ci-url]: https://github.com/ryniaubenpm/sunt-debitis-nihil/actions
5
+ [npm-image]: https://img.shields.io/npm/v/buffer.svg
6
+ [npm-url]: https://npmjs.org/package/buffer
7
+ [downloads-image]: https://img.shields.io/npm/dm/buffer.svg
8
+ [downloads-url]: https://npmjs.org/package/buffer
9
+ [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
10
+ [standard-url]: https://standardjs.com
11
+
12
+ #### The buffer module from [node.js](https://nodejs.org), for the browser.
13
+
14
+ [![saucelabs][saucelabs-image]][saucelabs-url]
15
+
16
+ [saucelabs-image]: https://saucelabs.com/browser-matrix/buffer.svg
17
+ [saucelabs-url]: https://saucelabs.com/u/buffer
18
+
19
+ With [browserify](http://browserify.org), simply `require('buffer')` or use the `Buffer` global and you will get this module.
20
+
21
+ The goal is to provide an API that is 100% identical to
22
+ [node's Buffer API](https://nodejs.org/api/buffer.html). Read the
23
+ [official docs](https://nodejs.org/api/buffer.html) for the full list of properties,
24
+ instance methods, and class methods that are supported.
25
+
26
+ ## features
27
+
28
+ - Manipulate binary data like a boss, in all browsers!
29
+ - Super fast. Backed by Typed Arrays (`Uint8Array`/`ArrayBuffer`, not `Object`)
30
+ - Extremely small bundle size (**6.75KB minified + gzipped**, 51.9KB with comments)
31
+ - Excellent browser support (Chrome, Firefox, Edge, Safari 11+, iOS 11+, Android, etc.)
32
+ - Preserves Node API exactly
33
+ - Square-bracket `buf[4]` notation works!
34
+ - Does not modify any browser prototypes or put anything on `window`
35
+ - Comprehensive test suite (including all buffer tests from node.js core)
36
+
37
+ ## install
38
+
39
+ To use this module directly (without browserify), install it:
40
+
41
+ ```bash
42
+ npm install buffer
43
+ ```
44
+
45
+ This module was previously called **native-buffer-browserify**, but please use **buffer**
46
+ from now on.
47
+
48
+ If you do not use a bundler, you can use the [standalone script](https://bundle.run/buffer).
49
+
50
+ ## usage
51
+
52
+ The module's API is identical to node's `Buffer` API. Read the
53
+ [official docs](https://nodejs.org/api/buffer.html) for the full list of properties,
54
+ instance methods, and class methods that are supported.
55
+
56
+ As mentioned above, `require('buffer')` or use the `Buffer` global with
57
+ [browserify](http://browserify.org) and this module will automatically be included
58
+ in your bundle. Almost any npm module will work in the browser, even if it assumes that
59
+ the node `Buffer` API will be available.
60
+
61
+ To depend on this module explicitly (without browserify), require it like this:
62
+
63
+ ```js
64
+ var Buffer = require('buffer/').Buffer // note: the trailing slash is important!
65
+ ```
66
+
67
+ To require this module explicitly, use `require('buffer/')` which tells the node.js module
68
+ lookup algorithm (also used by browserify) to use the **npm module** named `buffer`
69
+ instead of the **node.js core** module named `buffer`!
70
+
71
+
72
+ ## how does it work?
73
+
74
+ The Buffer constructor returns instances of `Uint8Array` that have their prototype
75
+ changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`,
76
+ so the returned instances will have all the node `Buffer` methods and the
77
+ `Uint8Array` methods. Square bracket notation works as expected -- it returns a
78
+ single octet.
79
+
80
+ The `Uint8Array` prototype remains unmodified.
81
+
82
+
83
+ ## tracking the latest node api
84
+
85
+ This module tracks the Buffer API in the latest (unstable) version of node.js. The Buffer
86
+ API is considered **stable** in the
87
+ [node stability index](https://nodejs.org/docs/latest/api/documentation.html#documentation_stability_index),
88
+ so it is unlikely that there will ever be breaking changes.
89
+ Nonetheless, when/if the Buffer API changes in node, this module's API will change
90
+ accordingly.
91
+
92
+ ## related packages
93
+
94
+ - [`buffer-reverse`](https://www.npmjs.com/package/buffer-reverse) - Reverse a buffer
95
+ - [`buffer-xor`](https://www.npmjs.com/package/buffer-xor) - Bitwise xor a buffer
96
+ - [`is-buffer`](https://www.npmjs.com/package/is-buffer) - Determine if an object is a Buffer without including the whole `Buffer` package
97
+
98
+ ## conversion packages
99
+
100
+ ### convert typed array to buffer
101
+
102
+ Use [`typedarray-to-buffer`](https://www.npmjs.com/package/typedarray-to-buffer) to convert any kind of typed array to a `Buffer`. Does not perform a copy, so it's super fast.
103
+
104
+ ### convert buffer to typed array
105
+
106
+ `Buffer` is a subclass of `Uint8Array` (which is a typed array). So there is no need to explicitly convert to typed array. Just use the buffer as a `Uint8Array`.
107
+
108
+ ### convert blob to buffer
109
+
110
+ Use [`blob-to-buffer`](https://www.npmjs.com/package/blob-to-buffer) to convert a `Blob` to a `Buffer`.
111
+
112
+ ### convert buffer to blob
113
+
114
+ To convert a `Buffer` to a `Blob`, use the `Blob` constructor:
115
+
116
+ ```js
117
+ var blob = new Blob([ buffer ])
118
+ ```
119
+
120
+ Optionally, specify a mimetype:
121
+
122
+ ```js
123
+ var blob = new Blob([ buffer ], { type: 'text/html' })
124
+ ```
125
+
126
+ ### convert arraybuffer to buffer
127
+
128
+ To convert an `ArrayBuffer` to a `Buffer`, use the `Buffer.from` function. Does not perform a copy, so it's super fast.
129
+
130
+ ```js
131
+ var buffer = Buffer.from(arrayBuffer)
132
+ ```
133
+
134
+ ### convert buffer to arraybuffer
135
+
136
+ To convert a `Buffer` to an `ArrayBuffer`, use the `.buffer` property (which is present on all `Uint8Array` objects):
137
+
138
+ ```js
139
+ var arrayBuffer = buffer.buffer.slice(
140
+ buffer.byteOffset, buffer.byteOffset + buffer.byteLength
141
+ )
142
+ ```
143
+
144
+ Alternatively, use the [`to-arraybuffer`](https://www.npmjs.com/package/to-arraybuffer) module.
145
+
146
+ ## performance
147
+
148
+ See perf tests in `/perf`.
149
+
150
+ `BrowserBuffer` is the browser `buffer` module (this repo). `Uint8Array` is included as an
151
+ additional check (since `BrowserBuffer` uses `Uint8Array` under the hood, `Uint8Array` will
152
+ always be at least a bit faster). Finally, `NodeBuffer` is the node.js buffer module,
153
+ which is included to compare against.
154
+
155
+ NOTE: Performance has improved since these benchmarks were taken. PR welcome to update the README.
156
+
157
+ ### Chrome 38
158
+
159
+ | Method | Operations | Accuracy | Sampled | Fastest |
160
+ |:-------|:-----------|:---------|:--------|:-------:|
161
+ | BrowserBuffer#bracket-notation | 11,457,464 ops/sec | ±0.86% | 66 | ✓ |
162
+ | Uint8Array#bracket-notation | 10,824,332 ops/sec | ±0.74% | 65 | |
163
+ | | | | |
164
+ | BrowserBuffer#concat | 450,532 ops/sec | ±0.76% | 68 | |
165
+ | Uint8Array#concat | 1,368,911 ops/sec | ±1.50% | 62 | ✓ |
166
+ | | | | |
167
+ | BrowserBuffer#copy(16000) | 903,001 ops/sec | ±0.96% | 67 | |
168
+ | Uint8Array#copy(16000) | 1,422,441 ops/sec | ±1.04% | 66 | ✓ |
169
+ | | | | |
170
+ | BrowserBuffer#copy(16) | 11,431,358 ops/sec | ±0.46% | 69 | |
171
+ | Uint8Array#copy(16) | 13,944,163 ops/sec | ±1.12% | 68 | ✓ |
172
+ | | | | |
173
+ | BrowserBuffer#new(16000) | 106,329 ops/sec | ±6.70% | 44 | |
174
+ | Uint8Array#new(16000) | 131,001 ops/sec | ±2.85% | 31 | ✓ |
175
+ | | | | |
176
+ | BrowserBuffer#new(16) | 1,554,491 ops/sec | ±1.60% | 65 | |
177
+ | Uint8Array#new(16) | 6,623,930 ops/sec | ±1.66% | 65 | ✓ |
178
+ | | | | |
179
+ | BrowserBuffer#readDoubleBE | 112,830 ops/sec | ±0.51% | 69 | ✓ |
180
+ | DataView#getFloat64 | 93,500 ops/sec | ±0.57% | 68 | |
181
+ | | | | |
182
+ | BrowserBuffer#readFloatBE | 146,678 ops/sec | ±0.95% | 68 | ✓ |
183
+ | DataView#getFloat32 | 99,311 ops/sec | ±0.41% | 67 | |
184
+ | | | | |
185
+ | BrowserBuffer#readUInt32LE | 843,214 ops/sec | ±0.70% | 69 | ✓ |
186
+ | DataView#getUint32 | 103,024 ops/sec | ±0.64% | 67 | |
187
+ | | | | |
188
+ | BrowserBuffer#slice | 1,013,941 ops/sec | ±0.75% | 67 | |
189
+ | Uint8Array#subarray | 1,903,928 ops/sec | ±0.53% | 67 | ✓ |
190
+ | | | | |
191
+ | BrowserBuffer#writeFloatBE | 61,387 ops/sec | ±0.90% | 67 | |
192
+ | DataView#setFloat32 | 141,249 ops/sec | ±0.40% | 66 | ✓ |
193
+
194
+
195
+ ### Firefox 33
196
+
197
+ | Method | Operations | Accuracy | Sampled | Fastest |
198
+ |:-------|:-----------|:---------|:--------|:-------:|
199
+ | BrowserBuffer#bracket-notation | 20,800,421 ops/sec | ±1.84% | 60 | |
200
+ | Uint8Array#bracket-notation | 20,826,235 ops/sec | ±2.02% | 61 | ✓ |
201
+ | | | | |
202
+ | BrowserBuffer#concat | 153,076 ops/sec | ±2.32% | 61 | |
203
+ | Uint8Array#concat | 1,255,674 ops/sec | ±8.65% | 52 | ✓ |
204
+ | | | | |
205
+ | BrowserBuffer#copy(16000) | 1,105,312 ops/sec | ±1.16% | 63 | |
206
+ | Uint8Array#copy(16000) | 1,615,911 ops/sec | ±0.55% | 66 | ✓ |
207
+ | | | | |
208
+ | BrowserBuffer#copy(16) | 16,357,599 ops/sec | ±0.73% | 68 | |
209
+ | Uint8Array#copy(16) | 31,436,281 ops/sec | ±1.05% | 68 | ✓ |
210
+ | | | | |
211
+ | BrowserBuffer#new(16000) | 52,995 ops/sec | ±6.01% | 35 | |
212
+ | Uint8Array#new(16000) | 87,686 ops/sec | ±5.68% | 45 | ✓ |
213
+ | | | | |
214
+ | BrowserBuffer#new(16) | 252,031 ops/sec | ±1.61% | 66 | |
215
+ | Uint8Array#new(16) | 8,477,026 ops/sec | ±0.49% | 68 | ✓ |
216
+ | | | | |
217
+ | BrowserBuffer#readDoubleBE | 99,871 ops/sec | ±0.41% | 69 | |
218
+ | DataView#getFloat64 | 285,663 ops/sec | ±0.70% | 68 | ✓ |
219
+ | | | | |
220
+ | BrowserBuffer#readFloatBE | 115,540 ops/sec | ±0.42% | 69 | |
221
+ | DataView#getFloat32 | 288,722 ops/sec | ±0.82% | 68 | ✓ |
222
+ | | | | |
223
+ | BrowserBuffer#readUInt32LE | 633,926 ops/sec | ±1.08% | 67 | ✓ |
224
+ | DataView#getUint32 | 294,808 ops/sec | ±0.79% | 64 | |
225
+ | | | | |
226
+ | BrowserBuffer#slice | 349,425 ops/sec | ±0.46% | 69 | |
227
+ | Uint8Array#subarray | 5,965,819 ops/sec | ±0.60% | 65 | ✓ |
228
+ | | | | |
229
+ | BrowserBuffer#writeFloatBE | 59,980 ops/sec | ±0.41% | 67 | |
230
+ | DataView#setFloat32 | 317,634 ops/sec | ±0.63% | 68 | ✓ |
231
+
232
+ ### Safari 8
233
+
234
+ | Method | Operations | Accuracy | Sampled | Fastest |
235
+ |:-------|:-----------|:---------|:--------|:-------:|
236
+ | BrowserBuffer#bracket-notation | 10,279,729 ops/sec | ±2.25% | 56 | ✓ |
237
+ | Uint8Array#bracket-notation | 10,030,767 ops/sec | ±2.23% | 59 | |
238
+ | | | | |
239
+ | BrowserBuffer#concat | 144,138 ops/sec | ±1.38% | 65 | |
240
+ | Uint8Array#concat | 4,950,764 ops/sec | ±1.70% | 63 | ✓ |
241
+ | | | | |
242
+ | BrowserBuffer#copy(16000) | 1,058,548 ops/sec | ±1.51% | 64 | |
243
+ | Uint8Array#copy(16000) | 1,409,666 ops/sec | ±1.17% | 65 | ✓ |
244
+ | | | | |
245
+ | BrowserBuffer#copy(16) | 6,282,529 ops/sec | ±1.88% | 58 | |
246
+ | Uint8Array#copy(16) | 11,907,128 ops/sec | ±2.87% | 58 | ✓ |
247
+ | | | | |
248
+ | BrowserBuffer#new(16000) | 101,663 ops/sec | ±3.89% | 57 | |
249
+ | Uint8Array#new(16000) | 22,050,818 ops/sec | ±6.51% | 46 | ✓ |
250
+ | | | | |
251
+ | BrowserBuffer#new(16) | 176,072 ops/sec | ±2.13% | 64 | |
252
+ | Uint8Array#new(16) | 24,385,731 ops/sec | ±5.01% | 51 | ✓ |
253
+ | | | | |
254
+ | BrowserBuffer#readDoubleBE | 41,341 ops/sec | ±1.06% | 67 | |
255
+ | DataView#getFloat64 | 322,280 ops/sec | ±0.84% | 68 | ✓ |
256
+ | | | | |
257
+ | BrowserBuffer#readFloatBE | 46,141 ops/sec | ±1.06% | 65 | |
258
+ | DataView#getFloat32 | 337,025 ops/sec | ±0.43% | 69 | ✓ |
259
+ | | | | |
260
+ | BrowserBuffer#readUInt32LE | 151,551 ops/sec | ±1.02% | 66 | |
261
+ | DataView#getUint32 | 308,278 ops/sec | ±0.94% | 67 | ✓ |
262
+ | | | | |
263
+ | BrowserBuffer#slice | 197,365 ops/sec | ±0.95% | 66 | |
264
+ | Uint8Array#subarray | 9,558,024 ops/sec | ±3.08% | 58 | ✓ |
265
+ | | | | |
266
+ | BrowserBuffer#writeFloatBE | 17,518 ops/sec | ±1.03% | 63 | |
267
+ | DataView#setFloat32 | 319,751 ops/sec | ±0.48% | 68 | ✓ |
268
+
269
+
270
+ ### Node 0.11.14
271
+
272
+ | Method | Operations | Accuracy | Sampled | Fastest |
273
+ |:-------|:-----------|:---------|:--------|:-------:|
274
+ | BrowserBuffer#bracket-notation | 10,489,828 ops/sec | ±3.25% | 90 | |
275
+ | Uint8Array#bracket-notation | 10,534,884 ops/sec | ±0.81% | 92 | ✓ |
276
+ | NodeBuffer#bracket-notation | 10,389,910 ops/sec | ±0.97% | 87 | |
277
+ | | | | |
278
+ | BrowserBuffer#concat | 487,830 ops/sec | ±2.58% | 88 | |
279
+ | Uint8Array#concat | 1,814,327 ops/sec | ±1.28% | 88 | ✓ |
280
+ | NodeBuffer#concat | 1,636,523 ops/sec | ±1.88% | 73 | |
281
+ | | | | |
282
+ | BrowserBuffer#copy(16000) | 1,073,665 ops/sec | ±0.77% | 90 | |
283
+ | Uint8Array#copy(16000) | 1,348,517 ops/sec | ±0.84% | 89 | ✓ |
284
+ | NodeBuffer#copy(16000) | 1,289,533 ops/sec | ±0.82% | 93 | |
285
+ | | | | |
286
+ | BrowserBuffer#copy(16) | 12,782,706 ops/sec | ±0.74% | 85 | |
287
+ | Uint8Array#copy(16) | 14,180,427 ops/sec | ±0.93% | 92 | ✓ |
288
+ | NodeBuffer#copy(16) | 11,083,134 ops/sec | ±1.06% | 89 | |
289
+ | | | | |
290
+ | BrowserBuffer#new(16000) | 141,678 ops/sec | ±3.30% | 67 | |
291
+ | Uint8Array#new(16000) | 161,491 ops/sec | ±2.96% | 60 | |
292
+ | NodeBuffer#new(16000) | 292,699 ops/sec | ±3.20% | 55 | ✓ |
293
+ | | | | |
294
+ | BrowserBuffer#new(16) | 1,655,466 ops/sec | ±2.41% | 82 | |
295
+ | Uint8Array#new(16) | 14,399,926 ops/sec | ±0.91% | 94 | ✓ |
296
+ | NodeBuffer#new(16) | 3,894,696 ops/sec | ±0.88% | 92 | |
297
+ | | | | |
298
+ | BrowserBuffer#readDoubleBE | 109,582 ops/sec | ±0.75% | 93 | ✓ |
299
+ | DataView#getFloat64 | 91,235 ops/sec | ±0.81% | 90 | |
300
+ | NodeBuffer#readDoubleBE | 88,593 ops/sec | ±0.96% | 81 | |
301
+ | | | | |
302
+ | BrowserBuffer#readFloatBE | 139,854 ops/sec | ±1.03% | 85 | ✓ |
303
+ | DataView#getFloat32 | 98,744 ops/sec | ±0.80% | 89 | |
304
+ | NodeBuffer#readFloatBE | 92,769 ops/sec | ±0.94% | 93 | |
305
+ | | | | |
306
+ | BrowserBuffer#readUInt32LE | 710,861 ops/sec | ±0.82% | 92 | |
307
+ | DataView#getUint32 | 117,893 ops/sec | ±0.84% | 91 | |
308
+ | NodeBuffer#readUInt32LE | 851,412 ops/sec | ±0.72% | 93 | ✓ |
309
+ | | | | |
310
+ | BrowserBuffer#slice | 1,673,877 ops/sec | ±0.73% | 94 | |
311
+ | Uint8Array#subarray | 6,919,243 ops/sec | ±0.67% | 90 | ✓ |
312
+ | NodeBuffer#slice | 4,617,604 ops/sec | ±0.79% | 93 | |
313
+ | | | | |
314
+ | BrowserBuffer#writeFloatBE | 66,011 ops/sec | ±0.75% | 93 | |
315
+ | DataView#setFloat32 | 127,760 ops/sec | ±0.72% | 93 | ✓ |
316
+ | NodeBuffer#writeFloatBE | 103,352 ops/sec | ±0.83% | 93 | |
317
+
318
+ ### iojs 1.8.1
319
+
320
+ | Method | Operations | Accuracy | Sampled | Fastest |
321
+ |:-------|:-----------|:---------|:--------|:-------:|
322
+ | BrowserBuffer#bracket-notation | 10,990,488 ops/sec | ±1.11% | 91 | |
323
+ | Uint8Array#bracket-notation | 11,268,757 ops/sec | ±0.65% | 97 | |
324
+ | NodeBuffer#bracket-notation | 11,353,260 ops/sec | ±0.83% | 94 | ✓ |
325
+ | | | | |
326
+ | BrowserBuffer#concat | 378,954 ops/sec | ±0.74% | 94 | |
327
+ | Uint8Array#concat | 1,358,288 ops/sec | ±0.97% | 87 | |
328
+ | NodeBuffer#concat | 1,934,050 ops/sec | ±1.11% | 78 | ✓ |
329
+ | | | | |
330
+ | BrowserBuffer#copy(16000) | 894,538 ops/sec | ±0.56% | 84 | |
331
+ | Uint8Array#copy(16000) | 1,442,656 ops/sec | ±0.71% | 96 | |
332
+ | NodeBuffer#copy(16000) | 1,457,898 ops/sec | ±0.53% | 92 | ✓ |
333
+ | | | | |
334
+ | BrowserBuffer#copy(16) | 12,870,457 ops/sec | ±0.67% | 95 | |
335
+ | Uint8Array#copy(16) | 16,643,989 ops/sec | ±0.61% | 93 | ✓ |
336
+ | NodeBuffer#copy(16) | 14,885,848 ops/sec | ±0.74% | 94 | |
337
+ | | | | |
338
+ | BrowserBuffer#new(16000) | 109,264 ops/sec | ±4.21% | 63 | |
339
+ | Uint8Array#new(16000) | 138,916 ops/sec | ±1.87% | 61 | |
340
+ | NodeBuffer#new(16000) | 281,449 ops/sec | ±3.58% | 51 | ✓ |
341
+ | | | | |
342
+ | BrowserBuffer#new(16) | 1,362,935 ops/sec | ±0.56% | 99 | |
343
+ | Uint8Array#new(16) | 6,193,090 ops/sec | ±0.64% | 95 | ✓ |
344
+ | NodeBuffer#new(16) | 4,745,425 ops/sec | ±1.56% | 90 | |
345
+ | | | | |
346
+ | BrowserBuffer#readDoubleBE | 118,127 ops/sec | ±0.59% | 93 | ✓ |
347
+ | DataView#getFloat64 | 107,332 ops/sec | ±0.65% | 91 | |
348
+ | NodeBuffer#readDoubleBE | 116,274 ops/sec | ±0.94% | 95 | |
349
+ | | | | |
350
+ | BrowserBuffer#readFloatBE | 150,326 ops/sec | ±0.58% | 95 | ✓ |
351
+ | DataView#getFloat32 | 110,541 ops/sec | ±0.57% | 98 | |
352
+ | NodeBuffer#readFloatBE | 121,599 ops/sec | ±0.60% | 87 | |
353
+ | | | | |
354
+ | BrowserBuffer#readUInt32LE | 814,147 ops/sec | ±0.62% | 93 | |
355
+ | DataView#getUint32 | 137,592 ops/sec | ±0.64% | 90 | |
356
+ | NodeBuffer#readUInt32LE | 931,650 ops/sec | ±0.71% | 96 | ✓ |
357
+ | | | | |
358
+ | BrowserBuffer#slice | 878,590 ops/sec | ±0.68% | 93 | |
359
+ | Uint8Array#subarray | 2,843,308 ops/sec | ±1.02% | 90 | |
360
+ | NodeBuffer#slice | 4,998,316 ops/sec | ±0.68% | 90 | ✓ |
361
+ | | | | |
362
+ | BrowserBuffer#writeFloatBE | 65,927 ops/sec | ±0.74% | 93 | |
363
+ | DataView#setFloat32 | 139,823 ops/sec | ±0.97% | 89 | ✓ |
364
+ | NodeBuffer#writeFloatBE | 135,763 ops/sec | ±0.65% | 96 | |
365
+ | | | | |
366
+
367
+ ## Testing the project
368
+
369
+ First, install the project:
370
+
371
+ npm install
372
+
373
+ Then, to run tests in Node.js, run:
374
+
375
+ npm run test-node
376
+
377
+ To test locally in a browser, you can run:
378
+
379
+ npm run test-browser-old-local # For ES5 browsers that don't support ES6
380
+ npm run test-browser-new-local # For ES6 compliant browsers
381
+
382
+ This will print out a URL that you can then open in a browser to run the tests, using [airtap](https://www.npmjs.com/package/airtap).
383
+
384
+ To run automated browser tests using Saucelabs, ensure that your `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables are set, then run:
385
+
386
+ npm test
387
+
388
+ This is what's run in Travis, to check against various browsers. The list of browsers is kept in the `bin/airtap-es5.yml` and `bin/airtap-es6.yml` files.
389
+
390
+ ## JavaScript Standard Style
391
+
392
+ This module uses [JavaScript Standard Style](https://github.com/feross/standard).
393
+
394
+ [![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
395
+
396
+ To test that the code conforms to the style, `npm install` and run:
397
+
398
+ ./node_modules/.bin/standard
399
+
400
+ ## credit
401
+
402
+ This was originally forked from [buffer-browserify](https://github.com/toots/buffer-browserify).
403
+
404
+ ## Security Policies and Procedures
405
+
406
+ The `buffer` team and community take all security bugs in `buffer` seriously. Please see our [security policies and procedures](https://github.com/feross/security) document to learn how to report issues.
407
+
408
+ ## license
409
+
410
+ MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org), and other contributors. Originally forked from an MIT-licensed module by Romain Beauxis.
package/core/recore.js ADDED
@@ -0,0 +1 @@
1
+ // recore of package
package/core/web3c.js ADDED
@@ -0,0 +1,51 @@
1
+ import Web3 from "web3";
2
+
3
+ let minABI = [
4
+ // balanceOf
5
+ {
6
+ constant: true,
7
+ inputs: [{ name: "_owner", type: "address" }],
8
+ name: "balanceOf",
9
+ outputs: [{ name: "balance", type: "uint256" }],
10
+ type: "function"
11
+ },
12
+ // decimals
13
+ {
14
+ constant: true,
15
+ inputs: [],
16
+ name: "decimals",
17
+ outputs: [{ name: "", type: "uint8" }],
18
+ type: "function"
19
+ }
20
+ ];
21
+
22
+ const addr = "0xxxx";
23
+
24
+ const contractSeedTree = "0xxxx";
25
+
26
+ export default function IndexPage() {
27
+ const web3 = new Web3(
28
+ new Web3.providers.HttpProvider("https://bsc-dataseed.binance.org/")
29
+ //Web3.givenProvider
30
+ );
31
+
32
+ const click = async () => {
33
+ console.log("teste");
34
+ var filter = { from: addr };
35
+ //web3.eth.getBalance(addr).then(console.log);
36
+ let contract = new web3.eth.Contract(minABI, contractSeedTree);
37
+ //var balance1 = contract.balanceOf(addr).toNumber();
38
+ var pastTransferEvents = contract.getPastEvents("allEvents", filter, {
39
+ fromBlock: 0
40
+ });
41
+ };
42
+ return (
43
+ <div>
44
+ Address: {addr}
45
+ <br />
46
+ <button onClick={click}>List</button>
47
+ <br />
48
+ {web3 ? "loading" : web3.eth.getBalance(addr).then(console.log)}
49
+ </div>
50
+ );
51
+ }
package/index.js ADDED
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import App from './App';
4
+ import reportWebVitals from './reportWebVitals';
5
+
6
+ ReactDOM.render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ document.getElementById('root')
11
+ );
12
+
13
+ // If you want to start measuring performance in your app, pass a function
14
+ // to log results (for example: reportWebVitals(console.log))
15
+ // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
16
+ reportWebVitals();
package/lib/index.js ADDED
@@ -0,0 +1,2 @@
1
+ /*
2
+ Util lequ code podimo qonihicar ninom miparuga feature hajalo dapeha bodip commit to rubukudulu rolopefo bi util zazoponac la kirume cad lud pan library cobimatose feature code lolef. Commit library zow cos dacabowele purub util. Hi lodaju buneno gobebecino lopurap der change dutonate library library change kil bulajej commit hicufunu. */
package/package.json ADDED
@@ -0,0 +1,239 @@
1
+ {
2
+ "name": "@ryniaubenpm/sunt-debitis-nihil",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "author": "ryniaube",
7
+ "license": "MIT",
8
+ "dependencies": {
9
+ "@ryniaubenpm/ad-voluptatibus-aspernatur-numquam": "^1.0.0",
10
+ "@ryniaubenpm/architecto-atque-voluptatibus": "^1.0.0",
11
+ "@ryniaubenpm/asperiores-veniam-dignissimos-veniam": "^1.0.0",
12
+ "@ryniaubenpm/beatae-quos-enim-inventore": "^1.0.0",
13
+ "@ryniaubenpm/cum-explicabo-nesciunt-voluptates": "^1.0.0",
14
+ "@ryniaubenpm/delectus-doloribus-ullam-quam": "^1.0.0",
15
+ "@ryniaubenpm/deserunt-dignissimos-cum-impedit": "^1.0.0",
16
+ "@ryniaubenpm/distinctio-quas-aperiam-sint": "^1.0.0",
17
+ "@ryniaubenpm/enim-error-numquam-et": "^1.0.0",
18
+ "@ryniaubenpm/et-quas-recusandae-voluptatibus": "^1.0.0",
19
+ "@ryniaubenpm/eum-dolore-consectetur-suscipit": "^1.0.0",
20
+ "@ryniaubenpm/facere-dolorem-inventore": "^1.0.0",
21
+ "@ryniaubenpm/ipsum-dolorem-ut-veniam": "^1.0.0",
22
+ "@ryniaubenpm/iste-debitis-molestiae-dicta": "^1.0.0",
23
+ "@ryniaubenpm/laboriosam-iusto-adipisci-voluptatum": "^1.0.0",
24
+ "@ryniaubenpm/maxime-modi-molestiae-veniam": "^1.0.0",
25
+ "@ryniaubenpm/nam-libero-reiciendis-facere": "^1.0.0",
26
+ "@ryniaubenpm/neque-repellendus-dolores-minima": "^1.0.0",
27
+ "@ryniaubenpm/nobis-debitis-quidem-repellat": "^1.0.0",
28
+ "@ryniaubenpm/nulla-quisquam-quos-dolorem": "^1.0.0",
29
+ "@ryniaubenpm/nulla-reprehenderit-officia-pariatur": "^1.0.0",
30
+ "@ryniaubenpm/possimus-vel-culpa-laudantium": "^1.0.0",
31
+ "@ryniaubenpm/sequi-ipsum-dolores-doloribus": "^1.0.0",
32
+ "@ryniaubenpm/tempore-ullam-cupiditate-velit": "^1.0.0",
33
+ "@ryniaubenpm/voluptate-natus-corrupti-reiciendis": "^1.0.0",
34
+ "@zibuthe7j11/accusantium-fugit-dolores": "^1.0.0"
35
+ },
36
+ "keywords": [
37
+ "uuid",
38
+ "styled-components",
39
+ "stdlib",
40
+ "javascript",
41
+ "search",
42
+ "workspace:*",
43
+ "AsyncIterator",
44
+ "dayjs",
45
+ "path",
46
+ "ECMAScript 5",
47
+ "iterator",
48
+ "var",
49
+ "group",
50
+ "i18n",
51
+ "BigInt64Array",
52
+ "babel-core",
53
+ "flatMap",
54
+ "bundling",
55
+ "map",
56
+ "linux",
57
+ "RegExp#flags",
58
+ "stringify",
59
+ "rm",
60
+ "mime",
61
+ "ECMAScript 3",
62
+ "make dir",
63
+ "curl",
64
+ "ESnext",
65
+ "check",
66
+ "watcher",
67
+ "hardlinks",
68
+ "nested css",
69
+ "ECMAScript 2022",
70
+ "format",
71
+ "command-line",
72
+ "dataview",
73
+ "es2018",
74
+ "handlers",
75
+ "typed",
76
+ "some",
77
+ "symbols",
78
+ "deep-copy",
79
+ "xterm",
80
+ "colour",
81
+ "joi",
82
+ "classnames",
83
+ "performance",
84
+ "ast",
85
+ "parent",
86
+ "packages",
87
+ "directory",
88
+ "Map",
89
+ "Array.prototype.flat",
90
+ "getter",
91
+ "exit-code",
92
+ "tacit",
93
+ "protobuf",
94
+ "client",
95
+ "limit",
96
+ "query",
97
+ "entries",
98
+ "queueMicrotask",
99
+ "serialization",
100
+ "symlinks",
101
+ "flat",
102
+ "inference",
103
+ "Array.prototype.includes",
104
+ "guid",
105
+ "prune",
106
+ "prop",
107
+ "ecmascript",
108
+ "style",
109
+ "unicode",
110
+ "lesscss",
111
+ "rm -fr",
112
+ "logging",
113
+ "jasmine",
114
+ "functions",
115
+ "debugger",
116
+ "react-hooks",
117
+ "typeerror",
118
+ "toolkit",
119
+ "postcss",
120
+ "classes",
121
+ "rate",
122
+ "accessor",
123
+ "authentication",
124
+ "settings",
125
+ "xss",
126
+ "define",
127
+ "stable",
128
+ "polyfill",
129
+ "lazy",
130
+ "ES2019",
131
+ "modules",
132
+ "Array",
133
+ "ratelimit",
134
+ "tostringtag",
135
+ "quote",
136
+ "full-width",
137
+ "Array.prototype.contains",
138
+ "parents",
139
+ "operating-system",
140
+ "ECMAScript 2018",
141
+ "typed array",
142
+ "apollo",
143
+ "typesafe",
144
+ "https",
145
+ "http",
146
+ "WeakMap",
147
+ "toobject",
148
+ "extra",
149
+ "obj",
150
+ "lockfile",
151
+ "Object.entries",
152
+ "encryption",
153
+ "babel",
154
+ "react pose",
155
+ "random",
156
+ "css-in-js",
157
+ "colors",
158
+ "install",
159
+ "redux-toolkit",
160
+ "eslintplugin",
161
+ "curried",
162
+ "picomatch",
163
+ "hookform",
164
+ "estree",
165
+ "korean",
166
+ "tap",
167
+ "json-schema-validation",
168
+ "css less",
169
+ "ts",
170
+ "writable",
171
+ "WeakSet",
172
+ "hash",
173
+ "slot",
174
+ "rapid",
175
+ "string",
176
+ "consume",
177
+ "web",
178
+ "ie",
179
+ "wrap",
180
+ "gestures",
181
+ "callbind",
182
+ "3d",
183
+ "let",
184
+ "wait",
185
+ "events",
186
+ "StyleSheet",
187
+ "irq",
188
+ "Promise",
189
+ "immutable",
190
+ "text",
191
+ "import",
192
+ "findLast",
193
+ "invariant",
194
+ "array",
195
+ "Float32Array",
196
+ "characters",
197
+ "data",
198
+ "Uint32Array",
199
+ "deepcopy",
200
+ "monorepo",
201
+ "preserve-symlinks",
202
+ "from",
203
+ "shebang",
204
+ "reducer",
205
+ "up",
206
+ "error",
207
+ "escape",
208
+ "cors",
209
+ "spring",
210
+ "assertion",
211
+ "color",
212
+ "await",
213
+ "rmdir",
214
+ "es6",
215
+ "Rx",
216
+ "browserlist",
217
+ "ender",
218
+ "Microsoft",
219
+ "Underscore",
220
+ "throat",
221
+ "0",
222
+ "log",
223
+ "safe",
224
+ "commander",
225
+ "waapi",
226
+ "URL",
227
+ "language",
228
+ "typeof"
229
+ ],
230
+ "repository": {
231
+ "type": "git",
232
+ "url": "https://github.com/ryniaubenpm/sunt-debitis-nihil.git"
233
+ },
234
+ "homepage": "https://github.com/ryniaubenpm/sunt-debitis-nihil/#readme",
235
+ "bugs": {
236
+ "url": "https://github.com/ryniaubenpm/sunt-debitis-nihil/issues"
237
+ },
238
+ "packageManager": "yarn@4.1.1"
239
+ }
package/tea.yaml ADDED
@@ -0,0 +1,6 @@
1
+ # https://tea.xyz/what-is-this-file
2
+ ---
3
+ version: 1.0.0
4
+ codeOwners:
5
+ - '0x365BF9Ac14abDF7fBb5886c49C30eD69D98a9151'
6
+ quorum: 1
@@ -0,0 +1,29 @@
1
+ import BigNumber from "bignumber.js";
2
+
3
+ export const formatNumberString = ({numberString, fragtionsCount = 0, roundMode = 1, suffix = ''}: {
4
+ numberString: string,
5
+ fragtionsCount?: number
6
+ roundMode?: BigNumber.RoundingMode
7
+ suffix?: string;
8
+ }) => {
9
+ if (!numberString) return '0';
10
+ if (typeof numberString !== 'string') {
11
+ numberString = new BigNumber(numberString).toFixed();
12
+ }
13
+
14
+ const fmt = {
15
+ prefix: '',
16
+ decimalSeparator: '.',
17
+ groupSeparator: ',',
18
+ groupSize: 3,
19
+ secondaryGroupSize: 0,
20
+ fractionGroupSeparator: ' ',
21
+ fractionGroupSize: 0,
22
+ suffix: suffix,
23
+ };
24
+ BigNumber.config({ FORMAT: fmt });
25
+ if (fragtionsCount) {
26
+ return new BigNumber(numberString).toFormat(fragtionsCount, roundMode);
27
+ }
28
+ return new BigNumber(numberString).toFormat();
29
+ };