bireader 1.0.15 → 1.0.17
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 +363 -212
- package/lib/cjs/src/common.js +902 -64
- package/lib/cjs/src/common.js.map +1 -1
- package/lib/cjs/src/reader.js +460 -342
- package/lib/cjs/src/reader.js.map +1 -1
- package/lib/cjs/src/writer.js +1775 -1959
- package/lib/cjs/src/writer.js.map +1 -1
- package/lib/cjs/types/src/common.d.ts +45 -7
- package/lib/cjs/types/src/common.d.ts.map +1 -1
- package/lib/cjs/types/src/reader.d.ts +271 -8
- package/lib/cjs/types/src/reader.d.ts.map +1 -1
- package/lib/cjs/types/src/writer.d.ts +1231 -1210
- package/lib/cjs/types/src/writer.d.ts.map +1 -1
- package/lib/esm/src/common.js +879 -63
- package/lib/esm/src/common.js.map +1 -1
- package/lib/esm/src/reader.js +461 -343
- package/lib/esm/src/reader.js.map +1 -1
- package/lib/esm/src/writer.js +1776 -1960
- package/lib/esm/src/writer.js.map +1 -1
- package/lib/esm/types/src/common.d.ts +45 -7
- package/lib/esm/types/src/common.d.ts.map +1 -1
- package/lib/esm/types/src/reader.d.ts +271 -8
- package/lib/esm/types/src/reader.d.ts.map +1 -1
- package/lib/esm/types/src/writer.d.ts +1231 -1210
- package/lib/esm/types/src/writer.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,145 +29,244 @@ Includes presents for quick parsing or programmable functions (examples below).
|
|
|
29
29
|
```javascript
|
|
30
30
|
import {bireader, biwriter} from 'bireader';
|
|
31
31
|
|
|
32
|
-
//parse a webp file
|
|
32
|
+
//read example - parse a webp file
|
|
33
33
|
function parse_webp(data){
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
34
|
+
const br = new bireader(data)
|
|
35
|
+
br.hexdump({supressUnicode:true}) //console.log data as hex
|
|
36
|
+
|
|
37
|
+
// 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
|
|
38
|
+
// 00000 52 49 46 46 98 3a 00 00 57 45 42 50 56 50 38 58 RIFF.:..WEBPVP8X
|
|
39
|
+
// 00010 0a 00 00 00 10 00 00 00 ff 00 00 ff 00 00 41 4c ..............AL
|
|
40
|
+
// 00020 50 48 26 10 00 00 01 19 45 6d 1b 49 4a 3b cf 0c PH&.....Em.IJ;..
|
|
41
|
+
// 00030 7f c0 7b 60 88 e8 ff 04 80 a2 82 65 56 d2 d2 86 ..{`.......eV...
|
|
42
|
+
// 00040 24 54 61 d0 83 8f 7f 0e 82 b6 6d e3 f0 a7 bd ed $Ta.......m.....
|
|
43
|
+
// 00050 87 10 11 13 40 3b 86 8f 26 4b d6 2a b7 6d 24 39 ....@;..&K.*.m$9
|
|
44
|
+
// 00060 52 4f fe 39 7f 3b 62 4e cc ec 9b 17 31 01 0c 24 RO.9.;bN....1..$
|
|
45
|
+
// 00070 49 89 23 e0 01 ab 52 64 e3 23 fc 61 db 76 cc 91 I.#...Rd.#.a.v..
|
|
46
|
+
// 00080 b6 7d fb 51 48 c5 69 db 4c 1b 63 db b6 ed b9 6d .}.QH.i.L.c....m
|
|
47
|
+
// 00090 db be 87 8d b1 6d db 9e b6 cd a4 d3 ee 24 95 54 .....m.......$.T
|
|
48
|
+
// 000a0 52 b8 8e 65 a9 eb 38 ce ab 52 75 9d 67 ff 75 2f R..e..8..Ru.g.u/
|
|
49
|
+
// 000b0 77 44 40 94 6d 25 6c 74 91 a8 88 86 58 9b da 6e wD@.m%lt....X..n
|
|
50
|
+
|
|
51
|
+
const header = {}
|
|
52
|
+
header.magic = br.string({length:4}) //RIFF
|
|
53
|
+
header.size = br.uint32le() //15000
|
|
54
|
+
header.fileSize = header.size + 8 //15008
|
|
55
|
+
header.payload = br.string({length:4}) //WEBP
|
|
56
|
+
header.format = br.string({length:4}) //VP8X
|
|
57
|
+
header.formatChunkSize = br.uint32le() //10
|
|
58
|
+
switch (header.format){
|
|
59
|
+
case "VP8 ":
|
|
60
|
+
header.formatType = "Lossy"
|
|
61
|
+
var read_size = 0
|
|
62
|
+
header.frame_tag = br.ubit24()
|
|
63
|
+
read_size += 3;
|
|
64
|
+
header.key_frame = header.frame_tag & 0x1;
|
|
65
|
+
header.version = (header.frame_tag >> 1) & 0x7;
|
|
66
|
+
header.show_frame = (header.frame_tag >> 4) & 0x1;
|
|
67
|
+
header.first_part_size = (header.frame_tag >> 5) & 0x7FFFF;
|
|
68
|
+
header.start_code = br.ubit24() //should be 2752925
|
|
69
|
+
header.horizontal_size_code = br.ubit16();
|
|
70
|
+
header.width = header.horizontal_size_code & 0x3FFF;
|
|
71
|
+
header.horizontal_scale = header.horizontal_size_code >> 14;
|
|
72
|
+
header.vertical_size_code = br.ubit16();
|
|
73
|
+
header.height = header.vertical_size_code & 0x3FFF;
|
|
74
|
+
header.vertical_scale = header.vertical_size_code >> 14;
|
|
75
|
+
read_size += 7;
|
|
76
|
+
header.VP8data = br.extract(header.formatChunkSize - read_size, true)
|
|
77
|
+
break;
|
|
78
|
+
case "VP8L":
|
|
79
|
+
header.formatType = "Lossless"
|
|
80
|
+
var read_size = 0
|
|
81
|
+
header.signature = br.ubyte() //should be 47
|
|
82
|
+
read_size += 1;
|
|
83
|
+
header.readWidth = br.ubit14()
|
|
84
|
+
header.width = header.readWidth+1;
|
|
85
|
+
header.readHeight = br.ubit14()
|
|
86
|
+
header.height = header.readHeight+1;
|
|
87
|
+
header.alpha_is_used = br.bit1()
|
|
88
|
+
header.version_number = br.ubit3()
|
|
89
|
+
read_size += 4;
|
|
90
|
+
header.VP8Ldata = br.extract(header.formatChunkSize - read_size, true)
|
|
91
|
+
break;
|
|
92
|
+
case "VP8X":
|
|
93
|
+
header.formatType = "Extended"
|
|
94
|
+
br.big() //switch to Big Endian bit read
|
|
95
|
+
header.rsv = br.bit2() //Reserved
|
|
96
|
+
header.I = br.bit1() //ICC profile
|
|
97
|
+
header.L = br.bit1() //Alpha
|
|
98
|
+
header.E = br.bit1() //Exif
|
|
99
|
+
header.X = br.bit1() //XMP
|
|
100
|
+
header.A = br.bit1() //Animation
|
|
101
|
+
header.R = br.bit1() //Reserved
|
|
102
|
+
br.little() //return to little
|
|
103
|
+
header.rsv2 = br.ubit24()
|
|
104
|
+
header.widthMinus1 = br.ubit24()
|
|
105
|
+
header.width = header.widthMinus1 + 1
|
|
106
|
+
header.heightMinus1 = br.ubit24()
|
|
107
|
+
header.height = header.heightMinus1 + 1
|
|
108
|
+
if(header.I)
|
|
109
|
+
{
|
|
110
|
+
header.ICCP = br.string({length:4}) // Should be ICCP
|
|
111
|
+
header.ICCPChunkSize = br.uint32()
|
|
112
|
+
header.ICCPData = br.extract(header.ICCPChunkSize, true)
|
|
113
|
+
}
|
|
114
|
+
if(header.L)
|
|
115
|
+
{
|
|
116
|
+
header.ALPH = br.string({length:4}) // Should be ALPH
|
|
117
|
+
header.ALPHChunkSize = br.uint32() //4134
|
|
118
|
+
header.ALPHData = br.extract(header.ALPHChunkSize, true)
|
|
119
|
+
}
|
|
120
|
+
if(header.A)
|
|
121
|
+
{
|
|
122
|
+
header.ANI = br.string({length:4}) // Should be ANIM or ANIF
|
|
123
|
+
header.ANIChunkSize = br.uint32()
|
|
124
|
+
if(header.ANI == "ANIM")
|
|
109
125
|
{
|
|
110
|
-
header.
|
|
111
|
-
header.
|
|
112
|
-
header.
|
|
113
|
-
}
|
|
114
|
-
if(header.
|
|
115
|
-
{
|
|
116
|
-
header.ALPH = br.string({length:4}) // Should be ALPH
|
|
117
|
-
header.ALPHChunkSize = br.uint32() //4134
|
|
118
|
-
header.ALPHData = br.extract(header.ALPHChunkSize, true)
|
|
119
|
-
}
|
|
120
|
-
if(header.A)
|
|
126
|
+
header.BGColor = br.uint32()
|
|
127
|
+
header.loopCount = br.ushort()
|
|
128
|
+
header.ANIMData = br.extract(header.ANIChunkSize, true)
|
|
129
|
+
} else
|
|
130
|
+
if (header.ANI == "ANIF")
|
|
121
131
|
{
|
|
122
|
-
header.
|
|
123
|
-
header.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
header.readFrameWidth = br.ubit24()
|
|
135
|
-
header.readFrameHeight = br.ubit24()
|
|
136
|
-
header.frameWidth = readFrameWidth + 1
|
|
137
|
-
header.frameHeight = readFrameHeight + 1
|
|
138
|
-
header.duration = br.ubit24()
|
|
139
|
-
header.rsv3 = br.ubit6()
|
|
140
|
-
header.byte.B = br.bit1() //Blending
|
|
141
|
-
header.byte.D = br.bit1() //Disposal
|
|
142
|
-
header.frameData = br.extract(16, true)
|
|
143
|
-
header.ANIFData = br.extract(header.ANIChunkSize, true)
|
|
144
|
-
}
|
|
132
|
+
header.FrameX = br.ubit24()
|
|
133
|
+
header.FrameY = br.ubit24()
|
|
134
|
+
header.readFrameWidth = br.ubit24()
|
|
135
|
+
header.readFrameHeight = br.ubit24()
|
|
136
|
+
header.frameWidth = readFrameWidth + 1
|
|
137
|
+
header.frameHeight = readFrameHeight + 1
|
|
138
|
+
header.duration = br.ubit24()
|
|
139
|
+
header.rsv3 = br.ubit6()
|
|
140
|
+
header.byte.B = br.bit1() //Blending
|
|
141
|
+
header.byte.D = br.bit1() //Disposal
|
|
142
|
+
header.frameData = br.extract(16, true)
|
|
143
|
+
header.ANIFData = br.extract(header.ANIChunkSize, true)
|
|
145
144
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
145
|
+
}
|
|
146
|
+
header.extFormatStr = br.string({length:4})
|
|
147
|
+
header.extChunkSize = br.uint32()
|
|
148
|
+
header.extData = br.extract(header.extChunkSize, true)
|
|
149
|
+
if(header.E)
|
|
150
|
+
{
|
|
151
|
+
header.EXIF = br.string({length:4}) // Should be EXIF
|
|
152
|
+
header.EXIFChunkSize = br.uint32()
|
|
153
|
+
header.EXIFData = br.extract(header.EXIFChunkSize, true)
|
|
154
|
+
}
|
|
155
|
+
if(header.X)
|
|
156
|
+
{
|
|
157
|
+
header.XMP = br.string({length:4}) // Should be XMP
|
|
158
|
+
header.XMPChunkSize = br.uint32()
|
|
159
|
+
header.XMPMetaData = br.extract(header.XMPChunkSize, true)
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
default:
|
|
163
|
+
header.data = br.extract(header.formatChunkSize, true)
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
br.finished()
|
|
167
|
+
return header
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
//write example - write a webp file from read data
|
|
171
|
+
function write_webp(data){
|
|
172
|
+
const bw = new biwriter(new Uint8Arry(1)) //extends array as we write by default
|
|
173
|
+
bw.string("RIFF",{length:4})
|
|
174
|
+
bw.uint32le(0) //dummy for now, will be final size - 8
|
|
175
|
+
bw.string("WEBP",{length:4})
|
|
176
|
+
switch(data.format){
|
|
177
|
+
case "VP8 ":
|
|
178
|
+
bw.string("VP8 ",{length:4})
|
|
179
|
+
bw.uint32le(data.VP8data.length)
|
|
180
|
+
bw.ubit24(data.key_frame)
|
|
181
|
+
bw.ubit24(data.start_code)
|
|
182
|
+
bw.ubit16(data.horizontal_size_code)
|
|
183
|
+
bw.ubit16(data.vertical_size_code)
|
|
184
|
+
bw.overwrite(data.VP8data ,true)
|
|
185
|
+
break;
|
|
186
|
+
case "VP8L":
|
|
187
|
+
bw.string("VP8L",{length:4})
|
|
188
|
+
bw.uint32le(data.VP8Ldata.length - 4)
|
|
189
|
+
bw.ubyte(47)
|
|
190
|
+
bw.ubit14(data.width - 1)
|
|
191
|
+
bw.ubit14(data.heigth - 1)
|
|
192
|
+
bw.ubit1(data.alpha_is_used)
|
|
193
|
+
bw.bit3(data.version_number)
|
|
194
|
+
bw.overwrite(data.VP8Ldata,true)
|
|
195
|
+
break;
|
|
196
|
+
case "VP8X":
|
|
197
|
+
bw.string("VP8X",{length:4})
|
|
198
|
+
bw.uint32le(10)
|
|
199
|
+
bw.big()
|
|
200
|
+
bw.bit2(0)
|
|
201
|
+
bw.bit1(data.I)
|
|
202
|
+
bw.bit1(data.L)
|
|
203
|
+
bw.bit1(data.E)
|
|
204
|
+
bw.bit1(data.X)
|
|
205
|
+
bw.bit1(data.A)
|
|
206
|
+
bw.bit1(0)
|
|
207
|
+
bw.little()
|
|
208
|
+
bw.ubit24(data.rsv2)
|
|
209
|
+
bw.ubit24(data.width - 1)
|
|
210
|
+
bw.ubit24(data.height - 1)
|
|
211
|
+
if(data.I)
|
|
212
|
+
{
|
|
213
|
+
bw.string(data.ICCP, {length:4})
|
|
214
|
+
bw.uint32(data.ICCPData.length)
|
|
215
|
+
bw.replace(data.ICCPData, true)
|
|
216
|
+
}
|
|
217
|
+
if(data.L)
|
|
218
|
+
{
|
|
219
|
+
bw.string(data.ALPH, {length:4})
|
|
220
|
+
bw.uint32(data.ALPHData.length)
|
|
221
|
+
bw.replace(data.ALPHData)
|
|
222
|
+
}
|
|
223
|
+
if(data.A)
|
|
224
|
+
{
|
|
225
|
+
bw.string(data.ANI, {length:4})
|
|
226
|
+
bw.uint32(data.ANIChunkSize)
|
|
227
|
+
if(data.ANI == "ANIM")
|
|
228
|
+
{
|
|
229
|
+
bw.uint32(data.BGColor)
|
|
230
|
+
bw.ushort(data.loopCount)
|
|
231
|
+
bw.replace(data.ANIMData)
|
|
232
|
+
} else
|
|
233
|
+
if (data.ANI == "ANIF")
|
|
234
|
+
{
|
|
235
|
+
bw.ubit24(data.FrameX)
|
|
236
|
+
bw.ubit24(data.FrameY)
|
|
237
|
+
bw.ubit24(data.frameWidth - 1)
|
|
238
|
+
bw.ubit24(data.frameHeigh - 1)
|
|
239
|
+
bw.ubit24(data.duration)
|
|
240
|
+
bw.ubit6(data.rsv3)
|
|
241
|
+
bw.bit1(data.byte.B)
|
|
242
|
+
bw.bit1(data.byte.D)
|
|
243
|
+
bw.replace(data.frameData, true)
|
|
244
|
+
bw.replace(data.ANIFData, true)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
bw.string(data.extFormatStr, {length:4})
|
|
248
|
+
bw.uint32(data.extData.length)
|
|
249
|
+
bw.replace(data.extData, true)
|
|
250
|
+
if(data.E)
|
|
251
|
+
{
|
|
252
|
+
bw.string(data.EXIF, {length:4})
|
|
253
|
+
bw.uint32(data.EXIFData.length)
|
|
254
|
+
bw.replace( data.EXIFData, true)
|
|
255
|
+
}
|
|
256
|
+
if(data.X)
|
|
257
|
+
{
|
|
258
|
+
bw.string(data.XMP, {length:4})
|
|
259
|
+
bw.uint32(data.XMPMetaData.length)
|
|
260
|
+
bw.replace(data.XMPMetaData, true)
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
263
|
+
default:
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
bw.goto(4)
|
|
267
|
+
bw.uint32le(bw.size - 8) //write file size
|
|
268
|
+
return bw.return()
|
|
269
|
+
}
|
|
171
270
|
```
|
|
172
271
|
|
|
173
272
|
## Common Functions
|
|
@@ -179,7 +278,7 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
179
278
|
<tr>
|
|
180
279
|
<th align="center" colspan="2">Function</th>
|
|
181
280
|
<th align="center">Params (bold requires)</th>
|
|
182
|
-
<th align="left">
|
|
281
|
+
<th align="left">Desc</th>
|
|
183
282
|
</tr>
|
|
184
283
|
</thead>
|
|
185
284
|
<tbody>
|
|
@@ -190,7 +289,7 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
190
289
|
<td>Name</td>
|
|
191
290
|
<td>new bireader(<b>data</b>, byteOffset, bitOffset, endianess, strict)</td>
|
|
192
291
|
<td align="center" rowspan="2"><b>Buffer or Uint8Array</b>, byte offset (default 0), bit offset (default 0), endian big or little (default little), strict mode true to restrict extending initially supplied data (default true for reader, false for writer)</td>
|
|
193
|
-
<td rowspan="2">new Constructor</td>
|
|
292
|
+
<td rowspan="2">Start with new Constructor.<br><b>Note:</b> Data can always be found with .data</td>
|
|
194
293
|
</tr>
|
|
195
294
|
<tr>
|
|
196
295
|
<td>Name</td>
|
|
@@ -200,7 +299,7 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
200
299
|
<td>Name</td>
|
|
201
300
|
<td>endianness(<b>bigOrLittle</b>)</td>
|
|
202
301
|
<td align="center" rowspan="2"><b>big</b> or <b>little</b> (default little)</td>
|
|
203
|
-
<td rowspan="2">Can be changed at any time.</td>
|
|
302
|
+
<td rowspan="2">Set or change Endian. Can be changed at any time.</td>
|
|
204
303
|
</tr>
|
|
205
304
|
<tr>
|
|
206
305
|
<td>Presets</td>
|
|
@@ -208,13 +307,33 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
208
307
|
</tr>
|
|
209
308
|
<tr>
|
|
210
309
|
<td>Name</td>
|
|
211
|
-
<td>
|
|
310
|
+
<td>getOffset()</td>
|
|
311
|
+
<td align="center" rowspan="2">none</td>
|
|
312
|
+
<td rowspan="2">Gets current byte position.</td>
|
|
313
|
+
</tr>
|
|
314
|
+
<tr>
|
|
315
|
+
<td>Aliases</td>
|
|
316
|
+
<td>tell(), saveOffset()</td>
|
|
317
|
+
</tr>
|
|
318
|
+
<tr>
|
|
319
|
+
<td>Name</td>
|
|
320
|
+
<td>getOffsetBit()</td>
|
|
321
|
+
<td align="center" rowspan="2">none</td>
|
|
322
|
+
<td rowspan="2">Gets current bit position (0-7).</td>
|
|
323
|
+
</tr>
|
|
324
|
+
<tr>
|
|
325
|
+
<td>Aliases</td>
|
|
326
|
+
<td>tellB(), saveOffsetBit()</td>
|
|
327
|
+
</tr>
|
|
328
|
+
<tr>
|
|
329
|
+
<td>Name</td>
|
|
330
|
+
<td>getOffsetAbsBit()</td>
|
|
212
331
|
<td align="center" rowspan="2">none</td>
|
|
213
|
-
<td rowspan="2">Gets current
|
|
332
|
+
<td rowspan="2">Gets current absolute bit position from start of data.</td>
|
|
214
333
|
</tr>
|
|
215
334
|
<tr>
|
|
216
335
|
<td>Aliases</td>
|
|
217
|
-
<td>
|
|
336
|
+
<td>tellAbsB(), saveOffsetAbsBit()</td>
|
|
218
337
|
</tr>
|
|
219
338
|
<tr>
|
|
220
339
|
<td>Name</td>
|
|
@@ -224,37 +343,37 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
224
343
|
</tr>
|
|
225
344
|
<tr>
|
|
226
345
|
<td>Aliases</td>
|
|
227
|
-
<td>return()
|
|
346
|
+
<td>return()</td>
|
|
228
347
|
</tr>
|
|
229
348
|
<tr>
|
|
230
349
|
<td>Name</td>
|
|
231
350
|
<td>hexdump({length, startByte, supressUnicode})</td>
|
|
232
|
-
<td align="center">Length of dump,
|
|
233
|
-
<td >Console logs data.
|
|
351
|
+
<td align="center">Length of dump in bytes (default 192), byte position to start the dump (default current byte position), supress unicode character preview for cleaner columns (default false)</td>
|
|
352
|
+
<td >Console logs data. Will trigger on error unless turned off (see below)</td>
|
|
234
353
|
</tr>
|
|
235
354
|
<tr>
|
|
236
355
|
<td>Name</td>
|
|
237
356
|
<td>errorDumpOff()</td>
|
|
238
|
-
<td align="center"
|
|
357
|
+
<td align="center">None</td>
|
|
239
358
|
<td >Does not hexdump on error (default true)</td>
|
|
240
359
|
</tr>
|
|
241
360
|
<tr>
|
|
242
361
|
<td>Name</td>
|
|
243
362
|
<td>errorDumpOn()</td>
|
|
244
|
-
<td align="center"
|
|
245
|
-
<td >
|
|
363
|
+
<td align="center">None</td>
|
|
364
|
+
<td >Will hexdump on error (default true)</td>
|
|
246
365
|
</tr>
|
|
247
366
|
<tr>
|
|
248
367
|
<td>Name</td>
|
|
249
368
|
<td>unrestrict()</td>
|
|
250
369
|
<td align="center">none</td>
|
|
251
|
-
<td>Sets strict mode to false, will extend array if data is outside of max size (default true for reader, false for writer)</td>
|
|
370
|
+
<td>Sets strict mode to false, will extend array if data is outside of max size (<b>default true for reader, false for writer</b>)</td>
|
|
252
371
|
</tr>
|
|
253
372
|
<tr>
|
|
254
373
|
<td>Name</td>
|
|
255
374
|
<td>restrict()</td>
|
|
256
375
|
<td align="center">none</td>
|
|
257
|
-
<td>Sets strict mode to true, won't extend array if data is outside of max size (default true for reader, false for writer)</td>
|
|
376
|
+
<td>Sets strict mode to true, won't extend array if data is outside of max size (<b>default true for reader, false for writer</b>)</td>
|
|
258
377
|
</tr>
|
|
259
378
|
<tr>
|
|
260
379
|
<td>Name</td>
|
|
@@ -264,14 +383,14 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
264
383
|
</tr>
|
|
265
384
|
<tr>
|
|
266
385
|
<td>Aliases</td>
|
|
267
|
-
<td>close()
|
|
386
|
+
<td>close(), done(), finished()</td>
|
|
268
387
|
</tr>
|
|
269
388
|
<th align="center" colspan="4"><i>Movement</i></th>
|
|
270
389
|
<tr>
|
|
271
390
|
<td>Name</td>
|
|
272
391
|
<td>skip(<b>bytes</b>, bits)</td>
|
|
273
|
-
<td align="center" rowspan="2"><b>
|
|
274
|
-
<td rowspan="2">Use negative to go back.<br><b>Note:</b> Remaining bits are dropped when returning to a byte
|
|
392
|
+
<td align="center" rowspan="2"><b>Bytes to skip from current byte position</b>, bits to skip (default 0)</td>
|
|
393
|
+
<td rowspan="2">Use negative to go back.<br><b>Note:</b> Remaining bits are dropped when returning to a byte function.</td>
|
|
275
394
|
</tr>
|
|
276
395
|
<tr>
|
|
277
396
|
<td>Alias</td>
|
|
@@ -281,7 +400,7 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
281
400
|
<td>Name</td>
|
|
282
401
|
<td>goto(<b>byte</b>, bit)</td>
|
|
283
402
|
<td align="center" rowspan="2"><b>Byte offset from start</b>, bit offset from byte offset</td>
|
|
284
|
-
<td rowspan="2"><b>Note:</b> Remaining bits are drop when returning to byte
|
|
403
|
+
<td rowspan="2"><b>Note:</b> Remaining bits are drop when returning to byte function.</td>
|
|
285
404
|
</tr>
|
|
286
405
|
<tr>
|
|
287
406
|
<td>Aliases</td>
|
|
@@ -301,7 +420,7 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
301
420
|
<tr>
|
|
302
421
|
<td>Name</td>
|
|
303
422
|
<td>delete(startOffset, endOffset, consume)</td>
|
|
304
|
-
<td align="center" rowspan="2">
|
|
423
|
+
<td align="center" rowspan="2">Start byte of data (default 0), end byte of data (default current byte position), move byte position to after data read (default false)</td>
|
|
305
424
|
<td rowspan="2">Removes and returns data. <br><b>Note:</b> Errors on strict mode</td>
|
|
306
425
|
</tr>
|
|
307
426
|
<tr>
|
|
@@ -311,17 +430,27 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
311
430
|
<tr>
|
|
312
431
|
<td>Name</td>
|
|
313
432
|
<td>crop(<b>length</b>, consume)</td>
|
|
314
|
-
<td align="center" rowspan="2"><b>Number of bytes to read and remove</b>, move byte position to after data read (default false)</td>
|
|
433
|
+
<td align="center" rowspan="2"><b>Number of bytes to read and remove from current byte position</b>, move byte position to after data read (default false)</td>
|
|
315
434
|
<td rowspan="2">Removes and returns data from current byte position for length of data</b>.<br><b>Note:</b> Errors on strict mode</td>
|
|
316
435
|
</tr>
|
|
317
436
|
<tr>
|
|
318
437
|
<td>Alias</td>
|
|
319
438
|
<td>drop(<b>length</b>, consume)</td>
|
|
320
439
|
</tr>
|
|
440
|
+
<tr>
|
|
441
|
+
<td>Name</td>
|
|
442
|
+
<td>replace(<b>data</b>, consume, offset)</td>
|
|
443
|
+
<td align="center" rowspan="2"><b>Data to replace in supplied data</b>, move byte position to after data read (default false), byte position to start replace (default current byte position)</td>
|
|
444
|
+
<td rowspan="2">Replaces data at current byte or supplied offset.<br><b>Note:</b> Errors on strict mode</td>
|
|
445
|
+
</tr>
|
|
446
|
+
<tr>
|
|
447
|
+
<td>Alias</td>
|
|
448
|
+
<td>overwrite(<b>data</b>, consume, offset)</td>
|
|
449
|
+
</tr>
|
|
321
450
|
<tr>
|
|
322
451
|
<td>Name</td>
|
|
323
452
|
<td>lift(startByte, endByte, consume, fillValue)</td>
|
|
324
|
-
<td align="center" rowspan="2"
|
|
453
|
+
<td align="center" rowspan="2">Start of byte read (default current byte position), end of byte read (default end of data), move current byte position to end of byte read (default false), value to fill bytes (will <b>NOT</b> fill on default)</td>
|
|
325
454
|
<td rowspan="2">Returns data from supplied byte positions. <br><b>Note:</b> Only moves current byte position if consume is true. Only fills data if value is supplied</td>
|
|
326
455
|
</tr>
|
|
327
456
|
<tr>
|
|
@@ -341,12 +470,12 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
341
470
|
<tr>
|
|
342
471
|
<td>Name</td>
|
|
343
472
|
<td>insert(<b>data</b>, consume, offset)</td>
|
|
344
|
-
<td align="center" rowspan="2"><b>New data to insert</b>, move byte position to after data read (default false),
|
|
345
|
-
<td rowspan="2"
|
|
473
|
+
<td align="center" rowspan="2"><b>New data to insert</b>, move byte position to after data read (default false), byte position to insert (default current byte position)</td>
|
|
474
|
+
<td rowspan="2">Inserts new data into supplied data. <b>Note:</b> Data type must match supplied data. Errors on strict mode</td>
|
|
346
475
|
</tr>
|
|
347
476
|
<tr>
|
|
348
477
|
<td>Aliases</td>
|
|
349
|
-
<td>place(<b>data</b>, consume)</td>
|
|
478
|
+
<td>place(<b>data</b>, consume, offset)</td>
|
|
350
479
|
</tr>
|
|
351
480
|
<tr>
|
|
352
481
|
<td>Name</td>
|
|
@@ -371,66 +500,88 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
371
500
|
<th align="center" colspan="4"><i>Math</i></th>
|
|
372
501
|
<tr>
|
|
373
502
|
<td>Name</td>
|
|
374
|
-
<td>
|
|
503
|
+
<td>xor(<b>xorKey</b>, startOffset, endOffset, consume)
|
|
375
504
|
<td align="center"><b>Byte value, string, Uint8Array or Buffer</b>, byte position to start (default current position), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
376
|
-
<td >XOR data
|
|
505
|
+
<td >XOR data. <b>Note:</b> Will loop if operation length is longer than supplied key.</td>
|
|
377
506
|
</tr>
|
|
378
507
|
<tr>
|
|
379
508
|
<td>Name</td>
|
|
380
|
-
<td>
|
|
509
|
+
<td>xorThis(<b>xorKey</b>, length, consume)
|
|
381
510
|
<td align="center"><b>Byte value, string, Uint8Array or Buffer</b>, length of bytes starting at current byte (repeats when longer, default 1 byte for byte value, string length or end of data for string, array length or end of data for Uint8Array or Buffer), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
382
|
-
<td>XOR data
|
|
511
|
+
<td>XOR data <b>Note:</b> Will loop if operation length is longer than supplied key.</td>
|
|
383
512
|
</tr>
|
|
384
513
|
<tr>
|
|
385
514
|
<td>Name</td>
|
|
386
|
-
<td>
|
|
515
|
+
<td>or(<b>orKey</b>, startOffset, endOffset, consume)
|
|
387
516
|
<td align="center"><b>Byte value, string, Uint8Array or Buffer</b>, byte position to start (default current position), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
388
|
-
<td >OR data
|
|
517
|
+
<td >OR data <b>Note:</b> Will loop if operation length is longer than supplied key.</td>
|
|
389
518
|
</tr>
|
|
390
519
|
<tr>
|
|
391
520
|
<td>Name</td>
|
|
392
|
-
<td>
|
|
521
|
+
<td>orThis(<b>orKey</b>, length, consume)
|
|
393
522
|
<td align="center"><b>Byte value, string, Uint8Array or Buffer</b>, length of bytes starting at current byte (repeats when longer, default 1 byte for byte value, string length or end of data for string, array length or end of data for Uint8Array or Buffer), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
394
|
-
<td>OR data
|
|
523
|
+
<td>OR data <b>Note:</b> Will loop if operation length is longer than supplied key.</td>
|
|
395
524
|
</tr>
|
|
396
525
|
<tr>
|
|
397
526
|
<td>Name</td>
|
|
398
|
-
<td>
|
|
527
|
+
<td>and(<b>andKey</b>, startOffset, endOffset, consume)
|
|
399
528
|
<td align="center"><b>Byte value, string, Uint8Array or Buffer</b>, byte position to start (default current position), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
400
|
-
<td >AND data
|
|
529
|
+
<td >AND data <b>Note:</b> Will loop if operation length is longer than supplied key.</td>
|
|
401
530
|
</tr>
|
|
402
531
|
<tr>
|
|
403
532
|
<td>Name</td>
|
|
404
|
-
<td>
|
|
533
|
+
<td>andThis(<b>andKey</b>, length, consume)
|
|
405
534
|
<td align="center"><b>Byte value, string, Uint8Array or Buffer</b>, length of bytes starting at current byte (repeats when longer, default 1 byte for byte value, string length or end of data for string, array length or end of data for Uint8Array or Buffer), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
406
|
-
<td>AND data
|
|
535
|
+
<td>AND data <b>Note:</b> Will loop if operation length is longer than supplied key.</td>
|
|
407
536
|
</tr>
|
|
408
537
|
<tr>
|
|
409
538
|
<td>Name</td>
|
|
410
|
-
<td>
|
|
539
|
+
<td>add(<b>shiftValue</b>, startOffset, endOffset, consume)
|
|
540
|
+
<td align="center"><b>Value</b>, byte position to start (default current position), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
541
|
+
<td >Add value to data (per byte)</td>
|
|
542
|
+
</tr>
|
|
543
|
+
<tr>
|
|
544
|
+
<td>Name</td>
|
|
545
|
+
<td>addThis(<b>shiftValue</b>, length, consume)
|
|
546
|
+
<td align="center"><b>Value</b>, length of bytes starting at current byte (default 1), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
547
|
+
<td>Add value to data (per byte)</td>
|
|
548
|
+
</tr>
|
|
549
|
+
<tr>
|
|
550
|
+
<td>Name</td>
|
|
551
|
+
<td>not(startOffset, endOffset, consume)
|
|
552
|
+
<td align="center">Byte position to start (default current position), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
553
|
+
<td >NOT data (per byte)</td>
|
|
554
|
+
</tr>
|
|
555
|
+
<tr>
|
|
556
|
+
<td>Name</td>
|
|
557
|
+
<td>notThis(length, consume)
|
|
558
|
+
<td align="center">Length of bytes starting at current byte position (default 1), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
559
|
+
<td>NOT data (per byte)</td>
|
|
560
|
+
</tr>
|
|
561
|
+
<tr>
|
|
562
|
+
<td>Name</td>
|
|
563
|
+
<td>lShift(<b>shiftValue</b>, startOffset, endOffset, consume)
|
|
411
564
|
<td align="center"><b>Value</b>, byte position to start (default current position), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
412
565
|
<td >Left shift data (per byte)</td>
|
|
413
566
|
</tr>
|
|
414
567
|
<tr>
|
|
415
568
|
<td>Name</td>
|
|
416
|
-
<td>
|
|
569
|
+
<td>lShiftThis(<b>shiftValue</b>, length, consume)
|
|
417
570
|
<td align="center"><b>Value</b>, length of bytes starting at current byte (default 1), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
418
571
|
<td>Left shift data (per byte)</td>
|
|
419
572
|
</tr>
|
|
420
573
|
<tr>
|
|
421
574
|
<td>Name</td>
|
|
422
|
-
<td>
|
|
575
|
+
<td>rShift(<b>shiftValue</b>, startOffset, endOffset, consume)
|
|
423
576
|
<td align="center"><b>Value</b>, byte position to start (default current position), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
424
577
|
<td >Right shift data (per byte)</td>
|
|
425
578
|
</tr>
|
|
426
579
|
<tr>
|
|
427
580
|
<td>Name</td>
|
|
428
|
-
<td>
|
|
581
|
+
<td>rShiftThis(<b>shiftValue</b>, length, consume)
|
|
429
582
|
<td align="center"><b>Value</b>, length of bytes starting at current byte (default 1), byte position to end (default end of data), move byte position to after operation (default false)</td>
|
|
430
583
|
<td>Right shift data (per byte)</td>
|
|
431
584
|
</tr>
|
|
432
|
-
|
|
433
|
-
|
|
434
585
|
</tbody>
|
|
435
586
|
</table>
|
|
436
587
|
|
|
@@ -438,7 +589,7 @@ Common functions for setup, movement, manipulation and math shared by both.
|
|
|
438
589
|
|
|
439
590
|
Parse value as a bit field. There are 32 functions from bit1 to bit32 and can be signed or unsigned (with a ``u`` at the start) and in little or big endian order (``be`` or ``le`` at the end).
|
|
440
591
|
|
|
441
|
-
**Note:** Remaining bits are dropped when returning to a byte read. Example, after using ``bit4()`` then ``ubyte()``, the read locations drops the remaining 4 bits after ``bit4()`` when reading ``ubyte()``.
|
|
592
|
+
**Note:** Remaining bits are dropped when returning to a byte read. Example, after using ``bit4()`` then ``ubyte()``, the read locations drops the remaining 4 bits after ``bit4()`` when reading ``ubyte()``. Any bit reading under 8 will always be unsigned.
|
|
442
593
|
|
|
443
594
|
<table>
|
|
444
595
|
<thead>
|
|
@@ -455,8 +606,8 @@ Parse value as a bit field. There are 32 functions from bit1 to bit32 and can be
|
|
|
455
606
|
<td><b>number of bits</b>, if the value is returned unsigned, big or little endian</td>
|
|
456
607
|
</tr>
|
|
457
608
|
<tr>
|
|
458
|
-
<td>writeBit(<b>value, bits</b>,
|
|
459
|
-
<td><b>value to write, number of bits</b>,
|
|
609
|
+
<td>writeBit(<b>value, bits</b>, unsigned, endian)</td>
|
|
610
|
+
<td><b>value to write, number of bits</b>, if the value is written unsigned, big or little endian<br>Note: Will throw error if value is outside of size of data</td>
|
|
460
611
|
</tr>
|
|
461
612
|
<tr>
|
|
462
613
|
<td align="center"><b>Presets (reader)</b></td>
|
|
@@ -465,8 +616,8 @@ Parse value as a bit field. There are 32 functions from bit1 to bit32 and can be
|
|
|
465
616
|
</tr>
|
|
466
617
|
<tr>
|
|
467
618
|
<td align="center"><b>Presets (writer)</b></td>
|
|
468
|
-
<td>[u]bit{1-32}{le|be}(<b>value</b>,
|
|
469
|
-
<td><b>value to write</b>,
|
|
619
|
+
<td>[u]bit{1-32}{le|be}(<b>value</b>, *unsigned)</td>
|
|
620
|
+
<td><b>value to write</b>, if value is unsigned or not.<br>*Note: functions without the starting letter <u>u</u> can still be called unsigned when <b>true</b> is the <i>fourth</i> augment</td>
|
|
470
621
|
</tr>
|
|
471
622
|
</tbody>
|
|
472
623
|
</table>
|
|
@@ -500,8 +651,8 @@ Parse value as a byte (aka int8). Can be signed or unsigned (with a ``u`` at the
|
|
|
500
651
|
</tr>
|
|
501
652
|
<tr>
|
|
502
653
|
<td align="center"><b>Presets (writer)</b></td>
|
|
503
|
-
<td>[u]{byte|int8}(<b>value</b>,
|
|
504
|
-
<td><b>value to write</b>,
|
|
654
|
+
<td>[u]{byte|int8}(<b>value</b>, *unsigned)</td>
|
|
655
|
+
<td><b>value to write</b>, if value is signed or not.<br>*Note: functions without the starting letter <u>u</u> can still be called unsigned when <b>true</b> is the <i>third</i> augment</td>
|
|
505
656
|
</tr>
|
|
506
657
|
</tbody>
|
|
507
658
|
</table>
|
|
@@ -525,8 +676,8 @@ Parse value as a int16 (aka short or word). Can be signed or unsigned (with a ``
|
|
|
525
676
|
<td>if the value is returned unsigned, big or little endian</td>
|
|
526
677
|
</tr>
|
|
527
678
|
<tr>
|
|
528
|
-
<td>writeInt16(<b>value</b>,
|
|
529
|
-
<td><b>value to write</b>,
|
|
679
|
+
<td>writeInt16(<b>value</b>, unsigned, endian)</td>
|
|
680
|
+
<td><b>value to write</b>, if the value is written unsigned, big or little endian<br>Note: Will throw error if value is outside of size of data</td>
|
|
530
681
|
</tr>
|
|
531
682
|
<tr>
|
|
532
683
|
<td align="center"><b>Presets (reader)</b></td>
|
|
@@ -535,7 +686,7 @@ Parse value as a int16 (aka short or word). Can be signed or unsigned (with a ``
|
|
|
535
686
|
</tr>
|
|
536
687
|
<tr>
|
|
537
688
|
<td align="center"><b>Presets (writer)</b></td>
|
|
538
|
-
<td>[u]{int16|word|short}{be|le}(<b>value</b>,
|
|
689
|
+
<td>[u]{int16|word|short}{be|le}(<b>value</b>, *unsigned, *endian)</td>
|
|
539
690
|
<td><b>value to write</b>, if value is unsigned, big or little endian.<br>*Note: functions without the starting letter <u>u</u> can still be called unsigned when <b>true</b> is the <i>third</i> augment, and functions without ending letters <u>be</u> or <u>le</u> can still be called the endian in the <i>fourth</i> augment (does not overwite set endian).</td>
|
|
540
691
|
</tr>
|
|
541
692
|
</tbody>
|
|
@@ -560,8 +711,8 @@ Parse value as a half float (aka half). Can be in little or big endian order (``
|
|
|
560
711
|
<td>big or little endian</td>
|
|
561
712
|
</tr>
|
|
562
713
|
<tr>
|
|
563
|
-
<td>writeHalfFloat(<b>value</b>,
|
|
564
|
-
<td><b>value to write</b>,
|
|
714
|
+
<td>writeHalfFloat(<b>value</b>, endian)</td>
|
|
715
|
+
<td><b>value to write</b>, big or little endian<br>Note: Will throw error if value is outside of size of data</td>
|
|
565
716
|
</tr>
|
|
566
717
|
<tr>
|
|
567
718
|
<td align="center"><b>Presets (reader)</b></td>
|
|
@@ -570,8 +721,8 @@ Parse value as a half float (aka half). Can be in little or big endian order (``
|
|
|
570
721
|
</tr>
|
|
571
722
|
<tr>
|
|
572
723
|
<td align="center"><b>Presets (writer)</b></td>
|
|
573
|
-
<td>{halffloat|half}{be|le}(<b>value</b>,
|
|
574
|
-
<td><b>value to write</b>,
|
|
724
|
+
<td>{halffloat|half}{be|le}(<b>value</b>, *endian)</td>
|
|
725
|
+
<td><b>value to write</b>, big or little endian.<br>*Note: and functions without ending letters <u>be</u> or <u>le</u> can still be called the endian in the <i>second</i> augment (does not overwite set endian).</td>
|
|
575
726
|
</tr>
|
|
576
727
|
</tbody>
|
|
577
728
|
</table>
|
|
@@ -595,8 +746,8 @@ Parse value as a int32 (aka int, long or double). Can be signed or unsigned (wi
|
|
|
595
746
|
<td>if the value is returned unsigned, big or little endian</td>
|
|
596
747
|
</tr>
|
|
597
748
|
<tr>
|
|
598
|
-
<td>writeInt32(<b>value</b>,
|
|
599
|
-
<td><b>value to write</b>,
|
|
749
|
+
<td>writeInt32(<b>value</b>, unsigned, endian)</td>
|
|
750
|
+
<td><b>value to write</b>, if the value is written unsigned, big or little endian<br>Note: Will throw error if value is outside of size of data</td>
|
|
600
751
|
</tr>
|
|
601
752
|
<tr>
|
|
602
753
|
<td align="center"><b>Presets (reader)</b></td>
|
|
@@ -605,8 +756,8 @@ Parse value as a int32 (aka int, long or double). Can be signed or unsigned (wi
|
|
|
605
756
|
</tr>
|
|
606
757
|
<tr>
|
|
607
758
|
<td align="center"><b>Presets (writer)</b></td>
|
|
608
|
-
<td>[u]{int32|long|int|double}{be|le}(<b>value</b>,
|
|
609
|
-
<td><b>value to write</b>,
|
|
759
|
+
<td>[u]{int32|long|int|double}{be|le}(<b>value</b>, *unsigned, *endian)</td>
|
|
760
|
+
<td><b>value to write</b>, if value is unsigned, little or big endian<br>*Note: functions without the starting letter <u>u</u> can still be called unsigned when <b>true</b> is the <i>third</i> augment, and functions without ending letters <u>be</u> or <u>le</u> can still be called the endian in the <i>fourth</i> augment (does not overwite set endian).</td>
|
|
610
761
|
</tr>
|
|
611
762
|
</tbody>
|
|
612
763
|
</table>
|
|
@@ -630,8 +781,8 @@ Parse value as a float. Can be in little or big endian order (``be`` or ``le`` a
|
|
|
630
781
|
<td>big or little endian</td>
|
|
631
782
|
</tr>
|
|
632
783
|
<tr>
|
|
633
|
-
<td>writeInt64(<b>value</b>,
|
|
634
|
-
<td><b>value to write</b>,
|
|
784
|
+
<td>writeInt64(<b>value</b>, endian)</td>
|
|
785
|
+
<td><b>value to write</b>, big or little endian<br>Note: Will throw error if value is outside of size of data</td>
|
|
635
786
|
</tr>
|
|
636
787
|
<tr>
|
|
637
788
|
<td align="center"><b>Presets (reader)</b></td>
|
|
@@ -640,8 +791,8 @@ Parse value as a float. Can be in little or big endian order (``be`` or ``le`` a
|
|
|
640
791
|
</tr>
|
|
641
792
|
<tr>
|
|
642
793
|
<td align="center"><b>Presets (writer)</b></td>
|
|
643
|
-
<td>float{be|le}(<b>value</b>,
|
|
644
|
-
<td><b>value to write</b>,
|
|
794
|
+
<td>float{be|le}(<b>value</b>, *endian)</td>
|
|
795
|
+
<td><b>value to write</b>, big or little endian.<br>*Note: functions without ending letters <u>be</u> or <u>le</u> can still be called the endian in the <i>third</i> augment (does not overwite set endian).</td>
|
|
645
796
|
</tr>
|
|
646
797
|
</tbody>
|
|
647
798
|
</table>
|
|
@@ -665,8 +816,8 @@ Parse value as a int64 (aka quad or bigint). Can be signed or unsigned (with a `
|
|
|
665
816
|
<td>if the value is returned unsigned, big or little endian</td>
|
|
666
817
|
</tr>
|
|
667
818
|
<tr>
|
|
668
|
-
<td>writeInt64(<b>value</b>,
|
|
669
|
-
<td><b>value to write</b>,
|
|
819
|
+
<td>writeInt64(<b>value</b>, unsigned, endian)</td>
|
|
820
|
+
<td><b>value to write</b>, if the value is written unsigned, big or little endian<br>Note: Will throw error if value is outside of size of data</td>
|
|
670
821
|
</tr>
|
|
671
822
|
<tr>
|
|
672
823
|
<td align="center"><b>Presets (reader)</b></td>
|
|
@@ -675,8 +826,8 @@ Parse value as a int64 (aka quad or bigint). Can be signed or unsigned (with a `
|
|
|
675
826
|
</tr>
|
|
676
827
|
<tr>
|
|
677
828
|
<td align="center"><b>Presets (writer)</b></td>
|
|
678
|
-
<td>[u]{int64|quad|bigint}{be|le}(<b>value</b>,
|
|
679
|
-
<td><b>value to write</b>,
|
|
829
|
+
<td>[u]{int64|quad|bigint}{be|le}(<b>value</b>, *unsigned, *endian)</td>
|
|
830
|
+
<td><b>value to write</b>, if value is unsigned, big or little endian.<br>*Note: functions without the starting letter <u>u</u> can still be called unsigned when <b>true</b> is the <i>third</i> augment, and functions without ending letters <u>be</u> or <u>le</u> can still be called the endian in the <i>fourth</i> augment (does not overwite set endian).</td>
|
|
680
831
|
</tr>
|
|
681
832
|
</tbody>
|
|
682
833
|
</table>
|
|
@@ -700,8 +851,8 @@ Parse value as a double float (aka dfloat). Can be in little or big endian order
|
|
|
700
851
|
<td>big or little endian</td>
|
|
701
852
|
</tr>
|
|
702
853
|
<tr>
|
|
703
|
-
<td>writeDoubleFloat(<b>value</b>,
|
|
704
|
-
<td><b>value to write</b>,
|
|
854
|
+
<td>writeDoubleFloat(<b>value</b>, endian)</td>
|
|
855
|
+
<td><b>value to write</b>, big or little endian.<br>Note: Will throw error if value is outside of size of data</td>
|
|
705
856
|
</tr>
|
|
706
857
|
<tr>
|
|
707
858
|
<td align="center"><b>Presets (reader)</b></td>
|
|
@@ -710,8 +861,8 @@ Parse value as a double float (aka dfloat). Can be in little or big endian order
|
|
|
710
861
|
</tr>
|
|
711
862
|
<tr>
|
|
712
863
|
<td align="center"><b>Presets (writer)</b></td>
|
|
713
|
-
<td>{doublefloat|dfloat}{be|le}(<b>value</b>,
|
|
714
|
-
<td><b>Value to write</b>,
|
|
864
|
+
<td>{doublefloat|dfloat}{be|le}(<b>value</b>, *endian)</td>
|
|
865
|
+
<td><b>Value to write</b>, big or little endian.<br>*Note: functions without ending letters <u>be</u> or <u>le</u> can still be called the endian in the <i>third</i> augment (does not overwite set endian).</td>
|
|
715
866
|
</tr>
|
|
716
867
|
</tbody>
|
|
717
868
|
</table>
|
|
@@ -774,13 +925,13 @@ Presents include C or Unicode, Ansi and multiple pascals.
|
|
|
774
925
|
<tr>
|
|
775
926
|
<td align="center"><b>Presets (writer)</b></td>
|
|
776
927
|
<td>
|
|
777
|
-
{c|utf8}string(<b>string</b>,
|
|
778
|
-
ansistring(<b>string</b>,
|
|
779
|
-
{utf16|uni}string{be|le}(<b>string</b>,
|
|
780
|
-
pstring(<b>string</b>,
|
|
781
|
-
pstring{1|2|4}{be|le}(<b>string</b>,
|
|
782
|
-
wpstring{be|le}(<b>string</b>,
|
|
783
|
-
wpstring{1|2|4}{be|le}(<b>string</b>,
|
|
928
|
+
{c|utf8}string(<b>string</b>, length, terminateValue)<br><br>
|
|
929
|
+
ansistring(<b>string</b>, length, terminateValue)<br><br>
|
|
930
|
+
{utf16|uni}string{be|le}(<b>string</b>,length, terminateValue, *endian)<br><br>
|
|
931
|
+
pstring(<b>string</b>, lengthWriteSize, *endian)<br><br>
|
|
932
|
+
pstring{1|2|4}{be|le}(<b>string</b>, *endian)<br><br>
|
|
933
|
+
wpstring{be|le}(<b>string</b>, lengthWriteSize, *endian)<br><br>
|
|
934
|
+
wpstring{1|2|4}{be|le}(<b>string</b>, *endian)
|
|
784
935
|
</td>
|
|
785
936
|
<td>Based on above.<br><b>Note:</b> Presets use augments not a single object. Endian only needed when not part of function name. Does not override set endian.</td>
|
|
786
937
|
</tr>
|