bireader 3.1.5 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.browser.d.ts +4 -4
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.d.ts +5 -5
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.d.ts +5 -5
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/BiReader.d.ts +0 -339
- package/dist/BiReaderStream.d.ts +0 -340
- package/dist/BiWriter.d.ts +0 -344
- package/dist/BiWriterStream.d.ts +0 -347
- package/dist/aliases/BinaryAliasReader.d.ts +0 -4678
- package/dist/aliases/BinaryAliasWriter.d.ts +0 -4648
- package/dist/common.d.ts +0 -91
- package/dist/core/BiBase.d.ts +0 -1336
- package/dist/core/BiBaseStream.d.ts +0 -1383
- package/dist/indexBrowser.d.ts +0 -35
- package/dist/indexImport.d.ts +0 -21
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ import {BiReader, BiWriter} from 'bireader';
|
|
|
53
53
|
function parse_webp(data){
|
|
54
54
|
const br = new BiReader(data);
|
|
55
55
|
br.strSettings = {length: 4};
|
|
56
|
-
br.hexdump({
|
|
56
|
+
br.hexdump({suppressUnicode:true}); // console.log data as hex
|
|
57
57
|
|
|
58
58
|
// 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
59
59
|
// 00000 52 49 46 46 98 3a 00 00 57 45 42 50 56 50 38 58 RIFF.:..WEBPVP8X
|
|
@@ -428,8 +428,8 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
428
428
|
</tr>
|
|
429
429
|
<tr>
|
|
430
430
|
<td>Name</td>
|
|
431
|
-
<td>hexdump({length, startByte,
|
|
432
|
-
<td align="center">Length of dump in bytes (default 192), byte position to start the dump (default current byte position),
|
|
431
|
+
<td>hexdump({length, startByte, suppressUnicode})</td>
|
|
432
|
+
<td align="center">Length of dump in bytes (default 192), byte position to start the dump (default current byte position), Suppress unicode character preview for cleaner columns (default false)</td>
|
|
433
433
|
<td >Console logs data. Will trigger on error unless turned off (see below)</td>
|
|
434
434
|
</tr>
|
|
435
435
|
<tr>
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -33,9 +33,9 @@ type hexdumpOptions = {
|
|
|
33
33
|
*/
|
|
34
34
|
startByte?: number;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Suppress unicode character preview for even columns.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
suppressUnicode?: boolean;
|
|
39
39
|
/**
|
|
40
40
|
* Returns the hex dump string instead of logging it.
|
|
41
41
|
*/
|
|
@@ -48,7 +48,7 @@ type hexdumpOptions = {
|
|
|
48
48
|
* @param {hexdumpOptions?} options - hex dump options
|
|
49
49
|
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
50
50
|
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
51
|
-
* @param {boolean?} options.
|
|
51
|
+
* @param {boolean?} options.suppressUnicode - Suppress unicode character preview for even columns.
|
|
52
52
|
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
53
53
|
*/
|
|
54
54
|
declare function hexdump(src: Uint8Array | Buffer, options?: hexdumpOptions): void | string;
|
|
@@ -403,7 +403,7 @@ declare class BiBase {
|
|
|
403
403
|
* @param {hexdumpOptions?} options - hex dump options
|
|
404
404
|
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
405
405
|
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
406
|
-
* @param {boolean?} options.
|
|
406
|
+
* @param {boolean?} options.suppressUnicode - Suppress unicode character preview for even columns.
|
|
407
407
|
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
408
408
|
*/
|
|
409
409
|
hexdump(options?: hexdumpOptions): void | string;
|
package/dist/index.browser.js
CHANGED
|
@@ -14,7 +14,7 @@ function arraybuffcheck(obj) {
|
|
|
14
14
|
* @param {hexdumpOptions?} options - hex dump options
|
|
15
15
|
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
16
16
|
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
17
|
-
* @param {boolean?} options.
|
|
17
|
+
* @param {boolean?} options.suppressUnicode - Suppress unicode character preview for even columns.
|
|
18
18
|
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
19
19
|
*/
|
|
20
20
|
function hexdump(src, options = {}) {
|
|
@@ -56,7 +56,7 @@ function _hexDump(data, options = {}, start, end) {
|
|
|
56
56
|
value = value >>> 0;
|
|
57
57
|
return value;
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var suppressUnicode = options && options.suppressUnicode || false;
|
|
60
60
|
const rows = [];
|
|
61
61
|
var header = " 0 1 2 3 4 5 6 7 8 9 A B C D E F ";
|
|
62
62
|
var ending = "0123456789ABCDEF";
|
|
@@ -80,7 +80,7 @@ function _hexDump(data, options = {}, start, end) {
|
|
|
80
80
|
// Convert the byte to a character and add it to the result
|
|
81
81
|
result += String.fromCharCode(byte);
|
|
82
82
|
}
|
|
83
|
-
else if (
|
|
83
|
+
else if (suppressUnicode) {
|
|
84
84
|
result += '.';
|
|
85
85
|
}
|
|
86
86
|
else if (hex_check(byte, 1) == 0) {
|
|
@@ -2142,7 +2142,7 @@ class BiBase {
|
|
|
2142
2142
|
* @param {hexdumpOptions?} options - hex dump options
|
|
2143
2143
|
* @param {number?} options.length - number of bytes to log, default ``192`` or end of data
|
|
2144
2144
|
* @param {number?} options.startByte - byte to start dump (default ``0``)
|
|
2145
|
-
* @param {boolean?} options.
|
|
2145
|
+
* @param {boolean?} options.suppressUnicode - Suppress unicode character preview for even columns.
|
|
2146
2146
|
* @param {boolean?} options.returnString - Returns the hex dump string instead of logging it.
|
|
2147
2147
|
*/
|
|
2148
2148
|
hexdump(options = {}) {
|