file-type 16.5.3 → 17.1.0
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/browser.d.ts +22 -28
- package/browser.js +21 -19
- package/core.d.ts +364 -356
- package/core.js +1236 -1169
- package/index.d.ts +4 -17
- package/index.js +5 -24
- package/package.json +29 -16
- package/readme.md +114 -97
- package/supported.js +277 -278
- package/util.js +10 -12
package/supported.js
CHANGED
|
@@ -1,279 +1,278 @@
|
|
|
1
|
-
|
|
1
|
+
export const extensions = [
|
|
2
|
+
'jpg',
|
|
3
|
+
'png',
|
|
4
|
+
'apng',
|
|
5
|
+
'gif',
|
|
6
|
+
'webp',
|
|
7
|
+
'flif',
|
|
8
|
+
'xcf',
|
|
9
|
+
'cr2',
|
|
10
|
+
'cr3',
|
|
11
|
+
'orf',
|
|
12
|
+
'arw',
|
|
13
|
+
'dng',
|
|
14
|
+
'nef',
|
|
15
|
+
'rw2',
|
|
16
|
+
'raf',
|
|
17
|
+
'tif',
|
|
18
|
+
'bmp',
|
|
19
|
+
'icns',
|
|
20
|
+
'jxr',
|
|
21
|
+
'psd',
|
|
22
|
+
'indd',
|
|
23
|
+
'zip',
|
|
24
|
+
'tar',
|
|
25
|
+
'rar',
|
|
26
|
+
'gz',
|
|
27
|
+
'bz2',
|
|
28
|
+
'7z',
|
|
29
|
+
'dmg',
|
|
30
|
+
'mp4',
|
|
31
|
+
'mid',
|
|
32
|
+
'mkv',
|
|
33
|
+
'webm',
|
|
34
|
+
'mov',
|
|
35
|
+
'avi',
|
|
36
|
+
'mpg',
|
|
37
|
+
'mp2',
|
|
38
|
+
'mp3',
|
|
39
|
+
'm4a',
|
|
40
|
+
'oga',
|
|
41
|
+
'ogg',
|
|
42
|
+
'ogv',
|
|
43
|
+
'opus',
|
|
44
|
+
'flac',
|
|
45
|
+
'wav',
|
|
46
|
+
'spx',
|
|
47
|
+
'amr',
|
|
48
|
+
'pdf',
|
|
49
|
+
'epub',
|
|
50
|
+
'elf',
|
|
51
|
+
'exe',
|
|
52
|
+
'swf',
|
|
53
|
+
'rtf',
|
|
54
|
+
'wasm',
|
|
55
|
+
'woff',
|
|
56
|
+
'woff2',
|
|
57
|
+
'eot',
|
|
58
|
+
'ttf',
|
|
59
|
+
'otf',
|
|
60
|
+
'ico',
|
|
61
|
+
'flv',
|
|
62
|
+
'ps',
|
|
63
|
+
'xz',
|
|
64
|
+
'sqlite',
|
|
65
|
+
'nes',
|
|
66
|
+
'crx',
|
|
67
|
+
'xpi',
|
|
68
|
+
'cab',
|
|
69
|
+
'deb',
|
|
70
|
+
'ar',
|
|
71
|
+
'rpm',
|
|
72
|
+
'Z',
|
|
73
|
+
'lz',
|
|
74
|
+
'cfb',
|
|
75
|
+
'mxf',
|
|
76
|
+
'mts',
|
|
77
|
+
'blend',
|
|
78
|
+
'bpg',
|
|
79
|
+
'docx',
|
|
80
|
+
'pptx',
|
|
81
|
+
'xlsx',
|
|
82
|
+
'3gp',
|
|
83
|
+
'3g2',
|
|
84
|
+
'jp2',
|
|
85
|
+
'jpm',
|
|
86
|
+
'jpx',
|
|
87
|
+
'mj2',
|
|
88
|
+
'aif',
|
|
89
|
+
'qcp',
|
|
90
|
+
'odt',
|
|
91
|
+
'ods',
|
|
92
|
+
'odp',
|
|
93
|
+
'xml',
|
|
94
|
+
'mobi',
|
|
95
|
+
'heic',
|
|
96
|
+
'cur',
|
|
97
|
+
'ktx',
|
|
98
|
+
'ape',
|
|
99
|
+
'wv',
|
|
100
|
+
'dcm',
|
|
101
|
+
'ics',
|
|
102
|
+
'glb',
|
|
103
|
+
'pcap',
|
|
104
|
+
'dsf',
|
|
105
|
+
'lnk',
|
|
106
|
+
'alias',
|
|
107
|
+
'voc',
|
|
108
|
+
'ac3',
|
|
109
|
+
'm4v',
|
|
110
|
+
'm4p',
|
|
111
|
+
'm4b',
|
|
112
|
+
'f4v',
|
|
113
|
+
'f4p',
|
|
114
|
+
'f4b',
|
|
115
|
+
'f4a',
|
|
116
|
+
'mie',
|
|
117
|
+
'asf',
|
|
118
|
+
'ogm',
|
|
119
|
+
'ogx',
|
|
120
|
+
'mpc',
|
|
121
|
+
'arrow',
|
|
122
|
+
'shp',
|
|
123
|
+
'aac',
|
|
124
|
+
'mp1',
|
|
125
|
+
'it',
|
|
126
|
+
's3m',
|
|
127
|
+
'xm',
|
|
128
|
+
'ai',
|
|
129
|
+
'skp',
|
|
130
|
+
'avif',
|
|
131
|
+
'eps',
|
|
132
|
+
'lzh',
|
|
133
|
+
'pgp',
|
|
134
|
+
'asar',
|
|
135
|
+
'stl',
|
|
136
|
+
'chm',
|
|
137
|
+
'3mf',
|
|
138
|
+
'zst',
|
|
139
|
+
'jxl',
|
|
140
|
+
'vcf',
|
|
141
|
+
];
|
|
2
142
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
'3mf',
|
|
140
|
-
'zst',
|
|
141
|
-
'jxl',
|
|
142
|
-
'vcf'
|
|
143
|
-
],
|
|
144
|
-
mimeTypes: [
|
|
145
|
-
'image/jpeg',
|
|
146
|
-
'image/png',
|
|
147
|
-
'image/gif',
|
|
148
|
-
'image/webp',
|
|
149
|
-
'image/flif',
|
|
150
|
-
'image/x-xcf',
|
|
151
|
-
'image/x-canon-cr2',
|
|
152
|
-
'image/x-canon-cr3',
|
|
153
|
-
'image/tiff',
|
|
154
|
-
'image/bmp',
|
|
155
|
-
'image/vnd.ms-photo',
|
|
156
|
-
'image/vnd.adobe.photoshop',
|
|
157
|
-
'application/x-indesign',
|
|
158
|
-
'application/epub+zip',
|
|
159
|
-
'application/x-xpinstall',
|
|
160
|
-
'application/vnd.oasis.opendocument.text',
|
|
161
|
-
'application/vnd.oasis.opendocument.spreadsheet',
|
|
162
|
-
'application/vnd.oasis.opendocument.presentation',
|
|
163
|
-
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
164
|
-
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
165
|
-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
166
|
-
'application/zip',
|
|
167
|
-
'application/x-tar',
|
|
168
|
-
'application/x-rar-compressed',
|
|
169
|
-
'application/gzip',
|
|
170
|
-
'application/x-bzip2',
|
|
171
|
-
'application/x-7z-compressed',
|
|
172
|
-
'application/x-apple-diskimage',
|
|
173
|
-
'application/x-apache-arrow',
|
|
174
|
-
'video/mp4',
|
|
175
|
-
'audio/midi',
|
|
176
|
-
'video/x-matroska',
|
|
177
|
-
'video/webm',
|
|
178
|
-
'video/quicktime',
|
|
179
|
-
'video/vnd.avi',
|
|
180
|
-
'audio/vnd.wave',
|
|
181
|
-
'audio/qcelp',
|
|
182
|
-
'audio/x-ms-asf',
|
|
183
|
-
'video/x-ms-asf',
|
|
184
|
-
'application/vnd.ms-asf',
|
|
185
|
-
'video/mpeg',
|
|
186
|
-
'video/3gpp',
|
|
187
|
-
'audio/mpeg',
|
|
188
|
-
'audio/mp4', // RFC 4337
|
|
189
|
-
'audio/opus',
|
|
190
|
-
'video/ogg',
|
|
191
|
-
'audio/ogg',
|
|
192
|
-
'application/ogg',
|
|
193
|
-
'audio/x-flac',
|
|
194
|
-
'audio/ape',
|
|
195
|
-
'audio/wavpack',
|
|
196
|
-
'audio/amr',
|
|
197
|
-
'application/pdf',
|
|
198
|
-
'application/x-msdownload',
|
|
199
|
-
'application/x-shockwave-flash',
|
|
200
|
-
'application/rtf',
|
|
201
|
-
'application/wasm',
|
|
202
|
-
'font/woff',
|
|
203
|
-
'font/woff2',
|
|
204
|
-
'application/vnd.ms-fontobject',
|
|
205
|
-
'font/ttf',
|
|
206
|
-
'font/otf',
|
|
207
|
-
'image/x-icon',
|
|
208
|
-
'video/x-flv',
|
|
209
|
-
'application/postscript',
|
|
210
|
-
'application/eps',
|
|
211
|
-
'application/x-xz',
|
|
212
|
-
'application/x-sqlite3',
|
|
213
|
-
'application/x-nintendo-nes-rom',
|
|
214
|
-
'application/x-google-chrome-extension',
|
|
215
|
-
'application/vnd.ms-cab-compressed',
|
|
216
|
-
'application/x-deb',
|
|
217
|
-
'application/x-unix-archive',
|
|
218
|
-
'application/x-rpm',
|
|
219
|
-
'application/x-compress',
|
|
220
|
-
'application/x-lzip',
|
|
221
|
-
'application/x-cfb',
|
|
222
|
-
'application/x-mie',
|
|
223
|
-
'application/mxf',
|
|
224
|
-
'video/mp2t',
|
|
225
|
-
'application/x-blender',
|
|
226
|
-
'image/bpg',
|
|
227
|
-
'image/jp2',
|
|
228
|
-
'image/jpx',
|
|
229
|
-
'image/jpm',
|
|
230
|
-
'image/mj2',
|
|
231
|
-
'audio/aiff',
|
|
232
|
-
'application/xml',
|
|
233
|
-
'application/x-mobipocket-ebook',
|
|
234
|
-
'image/heif',
|
|
235
|
-
'image/heif-sequence',
|
|
236
|
-
'image/heic',
|
|
237
|
-
'image/heic-sequence',
|
|
238
|
-
'image/icns',
|
|
239
|
-
'image/ktx',
|
|
240
|
-
'application/dicom',
|
|
241
|
-
'audio/x-musepack',
|
|
242
|
-
'text/calendar',
|
|
243
|
-
'text/vcard',
|
|
244
|
-
'model/gltf-binary',
|
|
245
|
-
'application/vnd.tcpdump.pcap',
|
|
246
|
-
'audio/x-dsf', // Non-standard
|
|
247
|
-
'application/x.ms.shortcut', // Invented by us
|
|
248
|
-
'application/x.apple.alias', // Invented by us
|
|
249
|
-
'audio/x-voc',
|
|
250
|
-
'audio/vnd.dolby.dd-raw',
|
|
251
|
-
'audio/x-m4a',
|
|
252
|
-
'image/apng',
|
|
253
|
-
'image/x-olympus-orf',
|
|
254
|
-
'image/x-sony-arw',
|
|
255
|
-
'image/x-adobe-dng',
|
|
256
|
-
'image/x-nikon-nef',
|
|
257
|
-
'image/x-panasonic-rw2',
|
|
258
|
-
'image/x-fujifilm-raf',
|
|
259
|
-
'video/x-m4v',
|
|
260
|
-
'video/3gpp2',
|
|
261
|
-
'application/x-esri-shape',
|
|
262
|
-
'audio/aac',
|
|
263
|
-
'audio/x-it',
|
|
264
|
-
'audio/x-s3m',
|
|
265
|
-
'audio/x-xm',
|
|
266
|
-
'video/MP1S',
|
|
267
|
-
'video/MP2P',
|
|
268
|
-
'application/vnd.sketchup.skp',
|
|
269
|
-
'image/avif',
|
|
270
|
-
'application/x-lzh-compressed',
|
|
271
|
-
'application/pgp-encrypted',
|
|
272
|
-
'application/x-asar',
|
|
273
|
-
'model/stl',
|
|
274
|
-
'application/vnd.ms-htmlhelp',
|
|
275
|
-
'model/3mf',
|
|
276
|
-
'image/jxl',
|
|
277
|
-
'application/zstd'
|
|
278
|
-
]
|
|
279
|
-
};
|
|
143
|
+
export const mimeTypes = [
|
|
144
|
+
'image/jpeg',
|
|
145
|
+
'image/png',
|
|
146
|
+
'image/gif',
|
|
147
|
+
'image/webp',
|
|
148
|
+
'image/flif',
|
|
149
|
+
'image/x-xcf',
|
|
150
|
+
'image/x-canon-cr2',
|
|
151
|
+
'image/x-canon-cr3',
|
|
152
|
+
'image/tiff',
|
|
153
|
+
'image/bmp',
|
|
154
|
+
'image/vnd.ms-photo',
|
|
155
|
+
'image/vnd.adobe.photoshop',
|
|
156
|
+
'application/x-indesign',
|
|
157
|
+
'application/epub+zip',
|
|
158
|
+
'application/x-xpinstall',
|
|
159
|
+
'application/vnd.oasis.opendocument.text',
|
|
160
|
+
'application/vnd.oasis.opendocument.spreadsheet',
|
|
161
|
+
'application/vnd.oasis.opendocument.presentation',
|
|
162
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
163
|
+
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
164
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
165
|
+
'application/zip',
|
|
166
|
+
'application/x-tar',
|
|
167
|
+
'application/x-rar-compressed',
|
|
168
|
+
'application/gzip',
|
|
169
|
+
'application/x-bzip2',
|
|
170
|
+
'application/x-7z-compressed',
|
|
171
|
+
'application/x-apple-diskimage',
|
|
172
|
+
'application/x-apache-arrow',
|
|
173
|
+
'video/mp4',
|
|
174
|
+
'audio/midi',
|
|
175
|
+
'video/x-matroska',
|
|
176
|
+
'video/webm',
|
|
177
|
+
'video/quicktime',
|
|
178
|
+
'video/vnd.avi',
|
|
179
|
+
'audio/vnd.wave',
|
|
180
|
+
'audio/qcelp',
|
|
181
|
+
'audio/x-ms-asf',
|
|
182
|
+
'video/x-ms-asf',
|
|
183
|
+
'application/vnd.ms-asf',
|
|
184
|
+
'video/mpeg',
|
|
185
|
+
'video/3gpp',
|
|
186
|
+
'audio/mpeg',
|
|
187
|
+
'audio/mp4', // RFC 4337
|
|
188
|
+
'audio/opus',
|
|
189
|
+
'video/ogg',
|
|
190
|
+
'audio/ogg',
|
|
191
|
+
'application/ogg',
|
|
192
|
+
'audio/x-flac',
|
|
193
|
+
'audio/ape',
|
|
194
|
+
'audio/wavpack',
|
|
195
|
+
'audio/amr',
|
|
196
|
+
'application/pdf',
|
|
197
|
+
'application/x-elf',
|
|
198
|
+
'application/x-msdownload',
|
|
199
|
+
'application/x-shockwave-flash',
|
|
200
|
+
'application/rtf',
|
|
201
|
+
'application/wasm',
|
|
202
|
+
'font/woff',
|
|
203
|
+
'font/woff2',
|
|
204
|
+
'application/vnd.ms-fontobject',
|
|
205
|
+
'font/ttf',
|
|
206
|
+
'font/otf',
|
|
207
|
+
'image/x-icon',
|
|
208
|
+
'video/x-flv',
|
|
209
|
+
'application/postscript',
|
|
210
|
+
'application/eps',
|
|
211
|
+
'application/x-xz',
|
|
212
|
+
'application/x-sqlite3',
|
|
213
|
+
'application/x-nintendo-nes-rom',
|
|
214
|
+
'application/x-google-chrome-extension',
|
|
215
|
+
'application/vnd.ms-cab-compressed',
|
|
216
|
+
'application/x-deb',
|
|
217
|
+
'application/x-unix-archive',
|
|
218
|
+
'application/x-rpm',
|
|
219
|
+
'application/x-compress',
|
|
220
|
+
'application/x-lzip',
|
|
221
|
+
'application/x-cfb',
|
|
222
|
+
'application/x-mie',
|
|
223
|
+
'application/mxf',
|
|
224
|
+
'video/mp2t',
|
|
225
|
+
'application/x-blender',
|
|
226
|
+
'image/bpg',
|
|
227
|
+
'image/jp2',
|
|
228
|
+
'image/jpx',
|
|
229
|
+
'image/jpm',
|
|
230
|
+
'image/mj2',
|
|
231
|
+
'audio/aiff',
|
|
232
|
+
'application/xml',
|
|
233
|
+
'application/x-mobipocket-ebook',
|
|
234
|
+
'image/heif',
|
|
235
|
+
'image/heif-sequence',
|
|
236
|
+
'image/heic',
|
|
237
|
+
'image/heic-sequence',
|
|
238
|
+
'image/icns',
|
|
239
|
+
'image/ktx',
|
|
240
|
+
'application/dicom',
|
|
241
|
+
'audio/x-musepack',
|
|
242
|
+
'text/calendar',
|
|
243
|
+
'text/vcard',
|
|
244
|
+
'model/gltf-binary',
|
|
245
|
+
'application/vnd.tcpdump.pcap',
|
|
246
|
+
'audio/x-dsf', // Non-standard
|
|
247
|
+
'application/x.ms.shortcut', // Invented by us
|
|
248
|
+
'application/x.apple.alias', // Invented by us
|
|
249
|
+
'audio/x-voc',
|
|
250
|
+
'audio/vnd.dolby.dd-raw',
|
|
251
|
+
'audio/x-m4a',
|
|
252
|
+
'image/apng',
|
|
253
|
+
'image/x-olympus-orf',
|
|
254
|
+
'image/x-sony-arw',
|
|
255
|
+
'image/x-adobe-dng',
|
|
256
|
+
'image/x-nikon-nef',
|
|
257
|
+
'image/x-panasonic-rw2',
|
|
258
|
+
'image/x-fujifilm-raf',
|
|
259
|
+
'video/x-m4v',
|
|
260
|
+
'video/3gpp2',
|
|
261
|
+
'application/x-esri-shape',
|
|
262
|
+
'audio/aac',
|
|
263
|
+
'audio/x-it',
|
|
264
|
+
'audio/x-s3m',
|
|
265
|
+
'audio/x-xm',
|
|
266
|
+
'video/MP1S',
|
|
267
|
+
'video/MP2P',
|
|
268
|
+
'application/vnd.sketchup.skp',
|
|
269
|
+
'image/avif',
|
|
270
|
+
'application/x-lzh-compressed',
|
|
271
|
+
'application/pgp-encrypted',
|
|
272
|
+
'application/x-asar',
|
|
273
|
+
'model/stl',
|
|
274
|
+
'application/vnd.ms-htmlhelp',
|
|
275
|
+
'model/3mf',
|
|
276
|
+
'image/jxl',
|
|
277
|
+
'application/zstd',
|
|
278
|
+
];
|
package/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function stringToBytes(string) {
|
|
2
|
+
return [...string].map(character => character.charCodeAt(0));
|
|
3
|
+
}
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
Checks whether the TAR checksum is valid.
|
|
@@ -9,9 +9,9 @@ Checks whether the TAR checksum is valid.
|
|
|
9
9
|
@param {number} offset - TAR header offset.
|
|
10
10
|
@returns {boolean} `true` if the TAR checksum is valid, otherwise `false`.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
const readSum = parseInt(buffer.toString('utf8', 148, 154).replace(/\0.*$/, '').trim(), 8); // Read sum in header
|
|
14
|
-
if (isNaN(readSum)) {
|
|
12
|
+
export function tarHeaderChecksumMatches(buffer, offset = 0) {
|
|
13
|
+
const readSum = Number.parseInt(buffer.toString('utf8', 148, 154).replace(/\0.*$/, '').trim(), 8); // Read sum in header
|
|
14
|
+
if (Number.isNaN(readSum)) {
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -26,15 +26,13 @@ exports.tarHeaderChecksumMatches = (buffer, offset = 0) => {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return readSum === sum;
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
ID3 UINT32 sync-safe tokenizer token.
|
|
33
33
|
28 bits (representing up to 256MB) integer, the msb is 0 to avoid "false syncsignals".
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
get: (buffer, offset) =>
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
len: 4
|
|
35
|
+
export const uint32SyncSafeToken = {
|
|
36
|
+
get: (buffer, offset) => (buffer[offset + 3] & 0x7F) | ((buffer[offset + 2]) << 7) | ((buffer[offset + 1]) << 14) | ((buffer[offset]) << 21),
|
|
37
|
+
len: 4,
|
|
40
38
|
};
|