vincenzo 0.0.2

A BitTorrent protocol library that powers the Vincenzo client.
Documentation
1
2
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
//! Extensions of the standard BitTorrent protocol
use bendy::{
    decoding::{self, FromBencode, Object, ResultExt}, encoding::ToBencode
};

use crate::error;

/// This is the payload of the extension protocol described on:
/// BEP 10 - Extension Protocol
/// <http://www.bittorrent.org/beps/bep_0010.html>
#[derive(Debug, Clone, PartialEq, Default)]
pub struct Extension {
    /// messages (dictionary of supported extensions)
    pub m: M,
    /// port
    pub p: Option<u16>,
    /// a string identifying the client and the version
    pub v: Option<String>,
    /// number of outstanding requests messages this client supports
    /// without dropping any.
    pub reqq: Option<u16>,
    /// added by BEP 9
    /// the size of the metadata file, which is the
    /// info-dictionary part of the metainfo(.torrent) file
    pub metadata_size: Option<u32>,
}

impl Extension {
    /// Extensions that the client supports
    pub fn supported(metadata_size: Option<u32>) -> Self {
        let m = M { ut_metadata: Some(3), ut_pex: None };
        Self {
            m,
            p: None,
            v: Some("Vincenzo 0.0.1".to_owned()),
            reqq: Some(6),
            metadata_size,
        }
    }
}

/// Messages of the Extension protocol
/// lists all extensions that a peer supports
/// in our case, we only support ut_metadata at the moment
/// and naturally, we are only interested in reading this part of the metadata
#[derive(Debug, Clone, Default, PartialEq)]
pub struct M {
    pub ut_metadata: Option<u8>,
    pub ut_pex: Option<u8>,
}

/// Metadata message used by Metadata Extension protocol (BEP 9)
/// this message is used to request, reject, and send data (info)
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Metadata {
    pub msg_type: u8,
    pub piece: u32,
    pub total_size: Option<u32>,
}

impl Metadata {
    pub fn request(piece: u32) -> Self {
        Self { msg_type: 0, piece, total_size: None }
    }
    pub fn data(piece: u32, info: &[u8]) -> Result<Vec<u8>, error::Error> {
        let metadata =
            Self { msg_type: 1, piece, total_size: Some(info.len() as u32) };

        let mut bytes =
            metadata.to_bencode().map_err(|_| error::Error::BencodeError)?;

        bytes.extend_from_slice(info);

        Ok(bytes)
    }
    pub fn reject(piece: u32) -> Self {
        Self { msg_type: 2, piece, total_size: None }
    }
    /// Tries to extract Info from the given buffer.
    ///
    /// # Errors
    ///
    /// This function will return an error if the buffer is not a valid Data
    /// type of the metadata extension protocol
    pub fn extract(mut buf: Vec<u8>) -> Result<(Self, Vec<u8>), error::Error> {
        // let mut info_buf = Vec::new();
        let mut metadata_buf = Vec::new();

        // find end of info dict, which is always the first "ee"
        if let Some(i) = buf.windows(2).position(|w| w == b"ee") {
            metadata_buf = buf.drain(..i + 2).collect();
        }

        let metadata = Metadata::from_bencode(&metadata_buf)
            .map_err(|_| error::Error::BencodeError)?;

        Ok((metadata, buf))
    }
}

impl FromBencode for Metadata {
    fn decode_bencode_object(object: Object) -> Result<Self, decoding::Error>
    where
        Self: Sized,
    {
        let mut msg_type = 0;
        let mut piece = 0;
        let mut total_size = None;

        let mut dict_dec = object.try_into_dictionary()?;

        while let Some(pair) = dict_dec.next_pair()? {
            match pair {
                (b"msg_type", value) => {
                    msg_type =
                        u8::decode_bencode_object(value).context("msg_type")?;
                }
                (b"piece", value) => {
                    piece =
                        u32::decode_bencode_object(value).context("piece")?;
                }
                (b"total_size", value) => {
                    total_size = u32::decode_bencode_object(value)
                        .context("total_size")
                        .map(Some)?;
                }
                _ => {}
            }
        }

        // Check that we discovered all necessary fields
        Ok(Self { msg_type, piece, total_size })
    }
}

impl ToBencode for Metadata {
    const MAX_DEPTH: usize = 20;
    fn encode(
        &self,
        encoder: bendy::encoding::SingleItemEncoder,
    ) -> Result<(), bendy::encoding::Error> {
        encoder.emit_dict(|mut e| {
            e.emit_pair(b"msg_type", self.msg_type)?;
            e.emit_pair(b"piece", self.piece)?;
            if let Some(total_size) = self.total_size {
                e.emit_pair(b"total_size", total_size)?;
            };
            Ok(())
        })?;
        Ok(())
    }
}

impl ToBencode for M {
    const MAX_DEPTH: usize = 20;
    fn encode(
        &self,
        encoder: bendy::encoding::SingleItemEncoder,
    ) -> Result<(), bendy::encoding::Error> {
        encoder.emit_dict(|mut e| {
            if let Some(ut_metadata) = self.ut_metadata {
                e.emit_pair(b"ut_metadata", ut_metadata)?;
            }
            if let Some(ut_pex) = self.ut_pex {
                e.emit_pair(b"ut_pex", ut_pex)?;
            }
            Ok(())
        })
    }
}

impl FromBencode for M {
    fn decode_bencode_object(
        object: Object,
    ) -> Result<Self, bendy::decoding::Error>
    where
        Self: Sized,
    {
        // the dict is the very first data structure of the bencoded string
        // a Rust Struct is the equivalent of a dict in bencode
        // and so that makes `Extension` struct the root dict of the bencoded
        // string
        let mut dict = object.try_into_dictionary()?;
        // inside this dict we have other data structures
        let mut ut_metadata = None;
        let mut ut_pex = None;

        while let Some(pair) = dict.next_pair()? {
            match pair {
                (b"ut_metadata", value) => {
                    ut_metadata = u8::decode_bencode_object(value)
                        .context("ut_metadata")
                        .map(Some)?;
                }
                (b"ut_pex", value) => {
                    ut_pex = u8::decode_bencode_object(value)
                        .context("ut_pex")
                        .map(Some)?;
                }
                _ => {}
            }
        }
        Ok(Self { ut_metadata, ut_pex })
    }
}

impl ToBencode for Extension {
    const MAX_DEPTH: usize = 20;
    fn encode(
        &self,
        encoder: bendy::encoding::SingleItemEncoder,
    ) -> Result<(), bendy::encoding::Error> {
        encoder.emit_dict(|mut e| {
            e.emit_pair(b"m", &self.m)?;
            if let Some(metadata_size) = self.metadata_size {
                e.emit_pair(b"metadata_size", metadata_size)?;
            }
            if let Some(p) = self.p {
                e.emit_pair(b"p", p)?;
            }
            if let Some(reqq) = self.reqq {
                e.emit_pair(b"reqq", reqq)?;
            }
            if let Some(v) = &self.v {
                e.emit_pair(b"v", v)?;
            }
            Ok(())
        })
    }
}

impl FromBencode for Extension {
    fn decode_bencode_object(
        object: Object,
    ) -> Result<Self, bendy::decoding::Error>
    where
        Self: Sized,
    {
        let mut dict = object.try_into_dictionary()?;
        let mut p = None;
        let mut v = None;
        let mut reqq = None;
        let mut metadata_size = None;
        let mut m = M::default();

        while let Some(pair) = dict.next_pair()? {
            match pair {
                (b"m", value) => {
                    m = M::decode_bencode_object(value).context("m")?
                }
                (b"metadata_size", value) => {
                    metadata_size = u32::decode_bencode_object(value)
                        .context("metadata_size")
                        .map(Some)?;
                }
                (b"p", value) => {
                    p = u16::decode_bencode_object(value)
                        .context("p")
                        .map(Some)?;
                }
                (b"reqq", value) => {
                    reqq = u16::decode_bencode_object(value)
                        .context("reqq")
                        .map(Some)?;
                }
                (b"v", value) => {
                    v = String::decode_bencode_object(value)
                        .context("v")
                        .map(Some)?;
                }
                _ => {}
            }
        }
        Ok(Self { m, p, v, reqq, metadata_size })
    }
}

#[cfg(test)]
mod tests {
    use crate::metainfo::MetaInfo;

    use super::*;

    #[test]
    fn metadata_request_roundtrip_serialization() {
        let metadata_request = Metadata::request(0);
        let bencoded =
            String::from_utf8(metadata_request.to_bencode().unwrap());
        assert_eq!(bencoded.unwrap(), "d8:msg_typei0e5:piecei0ee");

        let b = b"d8:msg_typei0e5:piecei0ee";
        let metadata = Metadata::from_bencode(b);
        assert_eq!(metadata_request, metadata.unwrap())
    }

    #[test]
    fn can_create_metadata_data() {
        let metainfo_bytes = include_bytes!("../../../test-files/book.torrent");
        let metainfo = MetaInfo::from_bencode(metainfo_bytes).unwrap();

        let info = metainfo.info;
        let metadata_data =
            Metadata::data(0, &info.clone().to_bencode().unwrap()).unwrap();

        let mut r = b"d8:msg_typei1e5:piecei0e10:total_sizei5095ee".to_vec();
        r.extend_from_slice(&info.to_bencode().unwrap());

        assert_eq!(r, metadata_data);
    }

    #[test]
    fn metadata_reject_roundtrip_serialization() {
        let metadata_request = Metadata::reject(0);
        let bencoded =
            String::from_utf8(metadata_request.to_bencode().unwrap());
        assert_eq!(bencoded.unwrap(), "d8:msg_typei2e5:piecei0ee");

        let b = b"d8:msg_typei2e5:piecei0ee";
        let metadata = Metadata::from_bencode(b);
        assert_eq!(metadata_request, metadata.unwrap())
    }

    // should transform a byte array into an Extension
    #[test]
    fn extension_deserialization() {
        let bytes = [
            100, 49, 58, 101, 105, 49, 101, 49, 58, 109, 100, 49, 49, 58, 117,
            116, 95, 109, 101, 116, 97, 100, 97, 116, 97, 105, 51, 101, 54, 58,
            117, 116, 95, 112, 101, 120, 105, 49, 101, 101, 49, 51, 58, 109,
            101, 116, 97, 100, 97, 116, 97, 95, 115, 105, 122, 101, 105, 53,
            50, 48, 53, 101, 49, 58, 112, 105, 53, 49, 52, 49, 51, 101, 52, 58,
            114, 101, 113, 113, 105, 53, 49, 50, 101, 49, 49, 58, 117, 112,
            108, 111, 97, 100, 95, 111, 110, 108, 121, 105, 49, 101, 49, 58,
            118, 49, 55, 58, 84, 114, 97, 110, 115, 109, 105, 115, 115, 105,
            111, 110, 32, 50, 46, 57, 52, 101,
        ];

        let ext = Extension::from_bencode(&bytes).unwrap();

        assert_eq!(
            ext,
            Extension {
                m: M { ut_metadata: Some(3), ut_pex: Some(1) },
                p: Some(51413),
                v: Some("Transmission 2.94".to_owned()),
                reqq: Some(512),
                metadata_size: Some(5205),
            }
        );
    }

    // should get a byte array, and encode to an Extension
    // should ignore all data structures that we do not care about
    #[test]
    fn extension_serialization() {
        let bytes = [
            100, 49, 58, 101, 105, 49, 101, 49, 58, 109, 100, 49, 49, 58, 117,
            116, 95, 109, 101, 116, 97, 100, 97, 116, 97, 105, 51, 101, 54, 58,
            117, 116, 95, 112, 101, 120, 105, 49, 101, 101, 49, 51, 58, 109,
            101, 116, 97, 100, 97, 116, 97, 95, 115, 105, 122, 101, 105, 53,
            50, 48, 53, 101, 49, 58, 112, 105, 53, 49, 52, 49, 51, 101, 52, 58,
            114, 101, 113, 113, 105, 53, 49, 50, 101, 49, 49, 58, 117, 112,
            108, 111, 97, 100, 95, 111, 110, 108, 121, 105, 49, 101, 49, 58,
            118, 49, 55, 58, 84, 114, 97, 110, 115, 109, 105, 115, 115, 105,
            111, 110, 32, 50, 46, 57, 52, 101,
        ];

        let ext = Extension::from_bencode(&bytes).unwrap();
        let extension_bytes = ext.to_bencode().unwrap();

        let extension = Extension::from_bencode(&extension_bytes).unwrap();

        assert_eq!(
            extension,
            Extension {
                m: M { ut_metadata: Some(3), ut_pex: Some(1) },
                p: Some(51413),
                v: Some("Transmission 2.94".to_owned()),
                reqq: Some(512),
                metadata_size: Some(5205),
            }
        );
    }

    #[test]
    fn metadata_msg_deserialization() {
        let buf = [
            100, 56, 58, 109, 115, 103, 95, 116, 121, 112, 101, 105, 49, 101,
            53, 58, 112, 105, 101, 99, 101, 105, 48, 101, 49, 48, 58, 116, 111,
            116, 97, 108, 95, 115, 105, 122, 101, 105, 53, 50, 48, 53, 101,
            101, 100, 53, 58, 102, 105, 108, 101, 115, 108, 100, 54, 58, 108,
            101, 110, 103, 116, 104, 105, 52, 48, 57, 50, 51, 51, 52, 101, 52,
            58, 112, 97, 116, 104, 108, 54, 50, 58, 75, 101, 114, 107, 111,
            117, 114, 32, 83, 46, 32, 66, 108, 97, 99, 107, 32, 72, 97, 116,
            32, 82, 117, 115, 116, 46, 46, 46, 82, 117, 115, 116, 32, 112, 114,
            111, 103, 114, 97, 109, 109, 105, 110, 103, 32, 108, 97, 110, 103,
            117, 97, 103, 101, 32, 50, 48, 50, 50, 46, 112, 100, 102, 101, 101,
            101, 52, 58, 110, 97, 109, 101, 53, 56, 58, 75, 101, 114, 107, 111,
            117, 114, 32, 83, 46, 32, 66, 108, 97, 99, 107, 32, 72, 97, 116,
            32, 82, 117, 115, 116, 46, 46, 46, 82, 117, 115, 116, 32, 112, 114,
            111, 103, 114, 97, 109, 109, 105, 110, 103, 32, 108, 97, 110, 103,
            117, 97, 103, 101, 32, 50, 48, 50, 50, 49, 50, 58, 112, 105, 101,
            99, 101, 32, 108, 101, 110, 103, 116, 104, 105, 49, 54, 51, 56, 52,
            101, 54, 58, 112, 105, 101, 99, 101, 115, 53, 48, 48, 48, 58, 55,
            26, 199, 154, 26, 88, 182, 115, 175, 110, 87, 204, 97, 157, 210,
            142, 77, 163, 225, 70, 38, 190, 30, 21, 121, 200, 181, 163, 247,
            253, 31, 110, 62, 85, 117, 33, 105, 13, 83, 159, 37, 71, 112, 25,
            244, 107, 121, 100, 232, 109, 167, 94, 85, 12, 244, 215, 42, 130,
            25, 51, 216, 75, 234, 57, 71, 119, 34, 136, 204, 121, 87, 103, 73,
            210, 204, 25, 237, 88, 138, 67, 18, 68, 40, 119, 164, 164, 3, 155,
            5, 249, 190, 54, 23, 176, 83, 183, 105, 142, 62, 180, 166, 149,
            207, 191, 105, 71, 135, 125, 147, 41, 157, 70, 237, 226, 154, 128,
            33, 72, 43, 212, 167, 194, 52, 212, 123, 187, 209, 27, 3, 180, 8,
            76, 159, 125, 246, 3, 209, 146, 219, 145, 244, 48, 5, 192, 189,
            158, 218, 92, 36, 75, 233, 209, 123, 73, 70, 133, 192, 19, 29, 116,
            198, 20, 211, 26, 131, 85, 165, 11, 84, 142, 244, 87, 134, 34, 213,
            202, 53, 43, 60, 248, 65, 223, 23, 252, 251, 45, 173, 106, 66, 253,
            43, 73, 155, 165, 74, 103, 92, 153, 138, 136, 188, 203, 102, 172,
            196, 165, 195, 214, 68, 158, 192, 67, 66, 69, 244, 108, 51, 47,
            109, 145, 165, 237, 14, 73, 157, 36, 230, 50, 124, 225, 53, 27,
            235, 243, 59, 129, 16, 104, 153, 87, 164, 3, 255, 104, 80, 161,
            180, 100, 204, 125, 101, 86, 253, 131, 31, 197, 198, 0, 84, 233,
            51, 122, 159, 158, 65, 41, 209, 60, 15, 198, 248, 250, 46, 29, 29,
            44, 194, 134, 120, 148, 170, 45, 61, 150, 40, 74, 112, 172, 240,
            40, 191, 242, 99, 131, 77, 1, 159, 222, 241, 134, 136, 110, 249,
            133, 148, 7, 247, 211, 200, 104, 61, 178, 165, 8, 142, 42, 112,
            108, 148, 42, 60, 189, 46, 81, 10, 156, 130, 59, 250, 78, 224, 201,
            164, 184, 10, 195, 145, 246, 2, 219, 98, 113, 29, 88, 155, 16, 136,
            178, 209, 198, 54, 47, 216, 39, 18, 122, 62, 250, 184, 132, 234,
            192, 88, 56, 157, 254, 114, 145, 182, 235, 163, 109, 244, 157, 112,
            147, 99, 130, 165, 49, 204, 82, 82, 112, 163, 82, 90, 217, 241, 13,
            39, 47, 59, 113, 175, 129, 18, 157, 131, 125, 162, 135, 252, 251,
            125, 14, 80, 27, 8, 245, 11, 206, 244, 70, 100, 167, 166, 233, 146,
            228, 98, 119, 79, 219, 104, 203, 160, 181, 55, 147, 207, 217, 229,
            29, 147, 240, 81, 249, 54, 139, 55, 211, 212, 201, 66, 143, 117,
            136, 46, 123, 175, 159, 209, 8, 30, 96, 66, 86, 162, 123, 144, 179,
            204, 87, 30, 47, 53, 21, 87, 53, 58, 127, 59, 212, 196, 117, 75,
            163, 228, 53, 31, 202, 55, 28, 229, 58, 98, 194, 183, 60, 64, 24,
            151, 127, 15, 10, 236, 59, 130, 18, 159, 90, 44, 165, 250, 123,
            201, 165, 97, 59, 114, 5, 132, 124, 179, 37, 84, 62, 55, 185, 179,
            121, 15, 103, 136, 117, 65, 178, 82, 101, 28, 78, 144, 126, 45,
            241, 76, 5, 246, 61, 184, 172, 65, 188, 38, 109, 205, 50, 48, 84,
            119, 93, 206, 255, 249, 201, 252, 43, 90, 250, 177, 250, 46, 96,
            153, 210, 27, 18, 61, 170, 83, 187, 183, 5, 16, 255, 184, 58, 38,
            166, 104, 30, 92, 236, 123, 250, 155, 45, 254, 6, 133, 17, 98, 243,
            33, 249, 143, 12, 121, 181, 99, 4, 73, 106, 228, 199, 110, 39, 56,
            151, 190, 69, 20, 177, 155, 116, 61, 252, 112, 135, 250, 10, 177,
            176, 48, 129, 198, 22, 197, 65, 185, 20, 54, 39, 57, 243, 170, 180,
            187, 101, 241, 164, 2, 23, 102, 111, 113, 215, 166, 0, 80, 86, 220,
            247, 164, 88, 220, 20, 247, 199, 157, 50, 234, 147, 27, 242, 142,
            26, 224, 42, 252, 14, 82, 23, 56, 47, 223, 191, 47, 119, 147, 200,
            206, 6, 79, 244, 62, 131, 71, 219, 78, 92, 19, 64, 18, 192, 109,
            178, 199, 205, 179, 13, 43, 23, 107, 197, 181, 146, 187, 85, 255,
            154, 180, 63, 202, 253, 67, 17, 53, 113, 166, 137, 19, 144, 90,
            248, 14, 4, 117, 117, 125, 76, 234, 180, 132, 162, 67, 49, 230,
            251, 200, 182, 11, 2, 244, 161, 173, 64, 171, 206, 41, 177, 237,
            203, 192, 173, 78, 129, 126, 53, 223, 179, 253, 106, 170, 236, 231,
            132, 149, 94, 156, 247, 89, 81, 163, 25, 137, 30, 196, 148, 179,
            45, 63, 39, 58, 20, 79, 156, 14, 58, 97, 78, 238, 198, 251, 105,
            98, 95, 32, 73, 181, 108, 22, 89, 255, 94, 2, 255, 52, 178, 104,
            152, 227, 177, 249, 37, 233, 245, 37, 208, 77, 252, 117, 134, 72,
            80, 107, 65, 245, 47, 191, 225, 59, 218, 215, 104, 147, 98, 160,
            130, 76, 86, 228, 89, 139, 163, 231, 208, 212, 161, 27, 61, 226,
            207, 110, 210, 229, 148, 60, 106, 147, 20, 72, 189, 202, 103, 165,
            208, 252, 138, 115, 241, 212, 47, 66, 214, 35, 145, 40, 146, 233,
            237, 45, 223, 109, 99, 144, 137, 74, 8, 66, 202, 121, 227, 110,
            238, 77, 186, 122, 141, 157, 156, 116, 112, 105, 66, 255, 136, 137,
            65, 230, 235, 132, 215, 198, 123, 231, 50, 174, 44, 36, 225, 4,
            147, 117, 24, 28, 72, 34, 58, 151, 176, 246, 15, 254, 54, 38, 186,
            18, 212, 184, 114, 67, 153, 169, 64, 250, 125, 204, 104, 221, 114,
            106, 241, 234, 116, 63, 237, 122, 250, 115, 133, 31, 209, 202, 71,
            127, 102, 132, 210, 252, 240, 98, 65, 210, 16, 49, 185, 91, 94, 94,
            72, 157, 37, 15, 178, 186, 235, 209, 117, 86, 66, 12, 67, 234, 100,
            232, 148, 215, 15, 235, 120, 13, 218, 40, 199, 159, 136, 24, 32,
            70, 126, 5, 210, 197, 28, 242, 211, 65, 29, 193, 134, 157, 251,
            214, 198, 53, 1, 19, 150, 133, 193, 39, 23, 217, 239, 58, 119, 25,
            183, 225, 253, 234, 81, 4, 168, 85, 6, 77, 113, 69, 17, 108, 149,
            155, 236, 16, 130, 4, 24, 221, 225, 56, 145, 81, 95, 242, 55, 158,
            129, 48, 9, 0, 116, 76, 178, 33, 248, 147, 144, 201, 96, 226, 198,
            197, 120, 41, 20, 72, 175, 51, 11, 109, 103, 103, 219, 133, 201,
            28, 65, 156, 138, 84, 157, 239, 58, 178, 207, 156, 121, 1, 73, 254,
            66, 120, 96, 69, 143, 158, 167, 235, 231, 20, 102, 66, 239, 136,
            102, 94, 27, 67, 26, 185, 172, 6, 253, 30, 32, 31, 144, 172, 240,
            93, 78, 42, 180, 13, 219, 252, 168, 5, 186, 145, 186, 200, 168, 57,
            170, 135, 178, 207, 194, 10, 204, 82, 152, 112, 195, 93, 68, 195,
            178, 252, 118, 148, 114, 138, 66, 1, 108, 48, 27, 36, 129, 57, 62,
            226, 196, 27, 132, 63, 210, 121, 13, 40, 76, 209, 246, 178, 167,
            254, 60, 178, 209, 84, 214, 173, 61, 63, 19, 194, 241, 45, 29, 75,
            230, 160, 252, 177, 203, 147, 39, 132, 43, 65, 4, 204, 16, 59, 214,
            52, 60, 209, 200, 61, 28, 63, 192, 95, 197, 29, 124, 116, 14, 225,
            252, 43, 230, 96, 196, 160, 193, 44, 4, 135, 57, 66, 153, 240, 53,
            28, 181, 96, 199, 16, 22, 243, 139, 237, 225, 215, 197, 67, 78,
            125, 171, 246, 227, 5, 221, 193, 84, 206, 216, 185, 55, 199, 18,
            118, 207, 17, 221, 207, 209, 74, 36, 172, 100, 232, 246, 225, 236,
            35, 84, 214, 230, 81, 151, 166, 238, 108, 251, 30, 216, 147, 126,
            123, 217, 35, 188, 181, 187, 181, 32, 59, 33, 70, 154, 142, 249, 6,
            25, 179, 124, 151, 33, 2, 212, 187, 80, 84, 244, 194, 79, 123, 151,
            200, 255, 67, 141, 216, 190, 35, 117, 199, 220, 159, 125, 209, 94,
            50, 244, 110, 24, 173, 198, 22, 54, 219, 50, 255, 14, 158, 182, 88,
            215, 77, 65, 209, 50, 157, 187, 92, 47, 174, 232, 188, 185, 87,
            202, 44, 165, 123, 165, 99, 120, 210, 159, 32, 63, 182, 149, 137,
            37, 83, 118, 47, 115, 73, 138, 237, 247, 53, 73, 103, 128, 49, 223,
            38, 48, 171, 245, 87, 147, 34, 167, 201, 73, 132, 118, 244, 181,
            199, 111, 202, 121, 124, 8, 162, 162, 216, 110, 216, 94, 33, 86,
            125, 71, 182, 117, 208, 189, 211, 49, 150, 227, 229, 43, 72, 31,
            128, 108, 204, 142, 139, 8, 219, 53, 168, 209, 223, 123, 117, 212,
            59, 215, 189, 229, 14, 172, 239, 54, 99, 174, 202, 108, 73, 98,
            170, 78, 99, 216, 62, 97, 140, 79, 246, 65, 138, 234, 238, 200,
            199, 252, 118, 151, 97, 153, 2, 236, 66, 44, 131, 6, 254, 206, 197,
            119, 124, 229, 226, 6, 189, 100, 81, 66, 27, 150, 1, 57, 107, 10,
            82, 242, 41, 38, 168, 44, 239, 253, 17, 90, 124, 56, 211, 24, 180,
            10, 106, 17, 50, 149, 206, 105, 0, 30, 45, 4, 60, 106, 95, 71, 51,
            106, 155, 64, 165, 154, 163, 62, 17, 179, 183, 248, 22, 176, 18,
            225, 47, 239, 71, 39, 165, 58, 91, 18, 248, 187, 198, 196, 187, 23,
            151, 129, 180, 207, 103, 236, 103, 25, 223, 81, 210, 155, 27, 109,
            47, 94, 80, 173, 194, 64, 247, 248, 172, 116, 1, 148, 226, 2, 155,
            223, 189, 233, 91, 105, 140, 172, 51, 163, 128, 233, 127, 157, 164,
            135, 83, 42, 20, 202, 190, 121, 214, 177, 147, 197, 40, 30, 154,
            16, 147, 213, 111, 62, 27, 240, 172, 137, 83, 111, 74, 224, 90,
            169, 103, 91, 212, 42, 108, 221, 67, 114, 254, 142, 202, 222, 178,
            91, 129, 202, 47, 11, 140, 235, 102, 198, 83, 201, 88, 170, 251,
            54, 156, 101, 10, 123, 120, 195, 208, 140, 150, 82, 120, 132, 57,
            112, 97, 161, 227, 165, 205, 145, 187, 190, 223, 159, 6, 23, 92,
            245, 157, 129, 201, 48, 10, 189, 156, 38, 228, 222, 199, 64, 145,
            12, 77, 104, 57, 122, 130, 90, 84, 11, 147, 196, 252, 219, 141,
            238, 127, 25, 184, 230, 248, 129, 157, 188, 34, 191, 244, 28, 204,
            248, 204, 210, 180, 101, 228, 8, 27, 161, 190, 229, 75, 108, 244,
            198, 162, 10, 198, 16, 76, 49, 138, 175, 82, 121, 5, 160, 40, 28,
            9, 64, 255, 96, 90, 168, 26, 150, 80, 98, 136, 192, 58, 254, 64, 3,
            32, 184, 157, 27, 56, 14, 244, 76, 142, 156, 82, 249, 10, 183, 125,
            3, 37, 238, 125, 110, 122, 95, 69, 164, 169, 192, 152, 202, 67,
            165, 23, 172, 47, 168, 113, 208, 68, 189, 247, 156, 158, 16, 62,
            27, 167, 155, 56, 12, 25, 73, 95, 147, 138, 173, 0, 125, 126, 61,
            105, 106, 241, 181, 131, 30, 228, 64, 220, 233, 116, 129, 207, 20,
            210, 9, 190, 240, 75, 86, 216, 209, 255, 91, 84, 175, 74, 119, 14,
            151, 90, 245, 221, 10, 176, 57, 137, 142, 55, 71, 108, 46, 35, 93,
            19, 199, 3, 11, 179, 244, 255, 198, 8, 19, 66, 141, 215, 111, 13,
            235, 241, 238, 194, 138, 72, 235, 209, 30, 114, 156, 175, 67, 243,
            43, 141, 74, 252, 237, 194, 44, 116, 165, 198, 86, 101, 52, 16, 29,
            110, 104, 19, 9, 219, 125, 0, 91, 224, 185, 70, 239, 28, 231, 162,
            101, 200, 125, 0, 225, 241, 79, 189, 167, 17, 214, 88, 28, 50, 178,
            240, 27, 220, 1, 51, 7, 27, 64, 226, 56, 68, 23, 207, 89, 200, 212,
            251, 24, 74, 199, 30, 84, 77, 57, 71, 254, 28, 228, 164, 100, 132,
            90, 36, 8, 220, 62, 195, 51, 40, 108, 178, 178, 56, 65, 11, 51,
            191, 73, 28, 238, 135, 104, 146, 42, 206, 62, 78, 194, 35, 241,
            234, 246, 140, 90, 102, 166, 8, 68, 174, 133, 156, 226, 24, 137,
            202, 243, 27, 249, 72, 41, 253, 23, 66, 179, 215, 123, 244, 201,
            69, 135, 88, 139, 229, 237, 248, 254, 23, 145, 106, 52, 69, 113,
            67, 183, 6, 4, 163, 20, 191, 92, 22, 149, 53, 157, 106, 251, 157,
            254, 9, 242, 40, 137, 46, 250, 176, 74, 23, 129, 102, 167, 153,
            153, 169, 37, 96, 81, 32, 111, 120, 125, 104, 101, 73, 16, 80, 117,
            167, 12, 103, 126, 129, 228, 11, 115, 36, 96, 132, 46, 202, 130,
            188, 49, 92, 174, 223, 83, 88, 184, 68, 239, 196, 43, 150, 141, 96,
            192, 248, 254, 101, 26, 35, 130, 202, 254, 117, 169, 125, 252, 161,
            182, 136, 184, 62, 169, 32, 203, 132, 44, 214, 85, 52, 43, 68, 191,
            197, 191, 211, 173, 75, 98, 212, 195, 61, 229, 43, 189, 193, 151,
            164, 164, 127, 117, 90, 169, 149, 129, 68, 91, 81, 100, 32, 106,
            200, 43, 14, 237, 208, 43, 148, 159, 9, 162, 156, 244, 66, 202, 71,
            81, 200, 30, 0, 43, 27, 205, 218, 206, 26, 151, 2, 17, 133, 113,
            74, 150, 114, 32, 214, 129, 81, 101, 241, 112, 27, 189, 126, 164,
            216, 6, 206, 235, 177, 87, 192, 33, 138, 243, 115, 125, 40, 222,
            32, 16, 243, 170, 101, 202, 19, 160, 35, 244, 113, 68, 120, 207,
            234, 58, 238, 26, 120, 195, 206, 112, 75, 160, 214, 19, 114, 254,
            109, 218, 151, 159, 170, 208, 19, 181, 247, 188, 175, 148, 89, 182,
            113, 125, 102, 31, 164, 88, 214, 83, 77, 91, 16, 247, 200, 2, 146,
            129, 23, 93, 218, 152, 56, 162, 69, 245, 64, 247, 95, 49, 62, 110,
            233, 115, 83, 130, 61, 54, 250, 254, 120, 125, 255, 74, 116, 139,
            58, 84, 233, 167, 81, 168, 65, 212, 203, 228, 37, 133, 226, 186,
            161, 77, 26, 30, 17, 69, 33, 31, 129, 212, 16, 164, 239, 154, 209,
            105, 137, 41, 40, 84, 232, 235, 52, 192, 143, 5, 110, 181, 75, 114,
            227, 82, 238, 142, 85, 21, 46, 20, 27, 10, 102, 176, 235, 23, 149,
            16, 45, 76, 230, 112, 127, 230, 19, 249, 56, 227, 116, 74, 199, 47,
            246, 187, 47, 129, 42, 227, 152, 64, 215, 110, 29, 252, 37, 208,
            51, 169, 195, 126, 102, 67, 186, 211, 95, 234, 19, 44, 192, 210,
            217, 215, 96, 15, 130, 245, 113, 159, 220, 195, 66, 192, 70, 30, 3,
            206, 134, 100, 217, 38, 159, 219, 82, 96, 160, 111, 59, 242, 50,
            167, 147, 74, 55, 23, 47, 50, 203, 116, 119, 67, 28, 46, 208, 222,
            107, 28, 130, 152, 219, 81, 209, 70, 118, 222, 59, 30, 89, 117,
            131, 41, 91, 93, 99, 224, 219, 98, 19, 219, 25, 184, 95, 114, 249,
            163, 229, 228, 97, 215, 132, 91, 198, 137, 250, 244, 31, 153, 219,
            167, 201, 220, 117, 55, 194, 116, 206, 170, 84, 112, 174, 128, 15,
            241, 78, 228, 8, 88, 51, 142, 82, 100, 230, 38, 143, 13, 130, 233,
            96, 240, 224, 121, 1, 207, 122, 239, 46, 61, 245, 12, 10, 42, 114,
            226, 40, 132, 171, 59, 151, 75, 101, 248, 48, 98, 40, 167, 183,
            182, 216, 170, 251, 171, 170, 56, 42, 16, 175, 228, 131, 93, 2,
            160, 18, 98, 5, 149, 113, 169, 119, 20, 241, 89, 167, 3, 209, 49,
            1, 63, 138, 68, 126, 120, 237, 7, 55, 93, 196, 155, 240, 190, 228,
            102, 154, 246, 166, 137, 240, 7, 192, 13, 170, 216, 140, 4, 219,
            238, 24, 58, 241, 107, 105, 173, 113, 245, 65, 65, 197, 241, 28,
            244, 1, 254, 157, 40, 101, 146, 121, 7, 165, 19, 39, 241, 52, 204,
            113, 93, 133, 182, 84, 189, 31, 134, 10, 133, 82, 130, 193, 2, 85,
            238, 8, 39, 199, 224, 59, 226, 234, 111, 195, 113, 172, 150, 123,
            19, 22, 205, 108, 89, 32, 35, 51, 148, 79, 243, 238, 230, 13, 64,
            80, 203, 231, 240, 199, 226, 168, 121, 36, 177, 102, 28, 228, 76,
            14, 246, 186, 46, 228, 72, 32, 190, 16, 224, 165, 211, 201, 123,
            102, 221, 47, 67, 106, 18, 222, 217, 21, 99, 133, 176, 130, 209,
            180, 215, 9, 12, 209, 137, 207, 239, 161, 244, 221, 210, 179, 196,
            69, 155, 128, 195, 179, 23, 191, 73, 38, 47, 37, 179, 129, 21, 20,
            75, 114, 108, 248, 69, 171, 176, 97, 96, 206, 242, 108, 213, 146,
            186, 233, 203, 57, 79, 230, 71, 2, 142, 206, 34, 101, 13, 54, 119,
            135, 68, 200, 38, 238, 137, 33, 73, 23, 34, 187, 2, 232, 70, 233,
            172, 62, 246, 35, 118, 183, 173, 216, 25, 179, 25, 168, 132, 203,
            119, 193, 24, 156, 195, 56, 103, 5, 120, 102, 31, 10, 234, 170,
            184, 189, 176, 17, 140, 89, 39, 253, 28, 85, 125, 237, 167, 17,
            150, 165, 85, 11, 47, 227, 53, 93, 151, 214, 153, 163, 223, 168,
            218, 232, 65, 185, 224, 138, 223, 248, 127, 204, 77, 230, 211, 60,
            197, 107, 219, 188, 167, 189, 172, 135, 153, 179, 168, 189, 114,
            205, 78, 12, 106, 111, 203, 226, 107, 15, 3, 40, 134, 103, 19, 205,
            152, 132, 118, 110, 168, 197, 231, 129, 77, 191, 173, 149, 31, 32,
            191, 89, 169, 102, 185, 52, 212, 24, 0, 57, 179, 132, 146, 115,
            245, 193, 166, 183, 181, 124, 108, 111, 38, 31, 133, 151, 213, 4,
            20, 119, 0, 49, 55, 229, 6, 95, 88, 185, 222, 170, 16, 177, 90, 57,
            24, 8, 71, 192, 89, 252, 107, 122, 12, 75, 216, 12, 178, 161, 141,
            7, 94, 252, 77, 233, 109, 151, 63, 116, 141, 147, 114, 142, 79, 9,
            104, 45, 102, 78, 239, 56, 161, 161, 187, 72, 77, 242, 126, 5, 24,
            241, 35, 134, 105, 254, 255, 148, 174, 230, 238, 89, 131, 21, 154,
            2, 129, 170, 15, 144, 81, 253, 159, 255, 108, 138, 38, 247, 237,
            13, 93, 153, 186, 109, 9, 220, 86, 225, 202, 114, 70, 188, 31, 72,
            37, 134, 51, 45, 44, 26, 243, 230, 5, 62, 23, 195, 225, 218, 244,
            14, 24, 20, 102, 249, 112, 113, 214, 14, 52, 123, 119, 53, 130, 56,
            164, 139, 128, 9, 147, 107, 160, 116, 7, 229, 220, 241, 167, 175,
            161, 36, 15, 212, 244, 244, 127, 242, 3, 55, 103, 212, 239, 143,
            214, 220, 181, 246, 84, 21, 141, 213, 114, 148, 60, 42, 138, 240,
            222, 11, 70, 198, 191, 43, 240, 165, 23, 15, 199, 96, 17, 28, 75,
            132, 9, 99, 246, 72, 114, 29, 55, 30, 98, 23, 149, 225, 127, 117,
            83, 42, 205, 100, 97, 51, 3, 178, 23, 219, 33, 252, 65, 158, 208,
            129, 45, 81, 95, 81, 162, 207, 115, 94, 54, 110, 108, 70, 217, 232,
            222, 109, 48, 10, 255, 39, 65, 207, 98, 144, 114, 120, 220, 184,
            73, 222, 71, 173, 139, 243, 47, 253, 148, 27, 113, 204, 99, 177,
            140, 59, 68, 116, 228, 194, 18, 215, 36, 20, 24, 216, 200, 4, 185,
            189, 101, 221, 48, 177, 254, 141, 78, 69, 233, 82, 102, 36, 242,
            128, 32, 216, 210, 207, 205, 128, 21, 240, 51, 53, 223, 124, 39,
            28, 52, 6, 229, 106, 134, 57, 116, 224, 221, 121, 202, 84, 204,
            163, 94, 93, 182, 173, 215, 190, 253, 214, 235, 197, 33, 59, 186,
            88, 157, 40, 122, 93, 130, 21, 50, 79, 116, 121, 108, 108, 189,
            232, 120, 144, 134, 151, 143, 32, 222, 100, 53, 112, 141, 119, 170,
            58, 14, 242, 165, 151, 239, 101, 165, 239, 56, 129, 18, 25, 222,
            131, 59, 25, 210, 1, 151, 140, 2, 196, 249, 188, 144, 247, 72, 104,
            24, 164, 54, 203, 229, 136, 34, 190, 69, 56, 12, 158, 209, 210,
            105, 225, 87, 64, 7, 124, 90, 70, 20, 47, 124, 224, 213, 135, 228,
            81, 28, 141, 82, 157, 66, 30, 149, 73, 217, 210, 192, 177, 195,
            179, 58, 192, 86, 122, 182, 208, 36, 32, 88, 222, 212, 95, 229, 31,
            218, 50, 199, 199, 87, 203, 95, 190, 184, 193, 146, 12, 85, 231,
            128, 162, 69, 150, 66, 85, 78, 132, 103, 248, 23, 43, 100, 59, 193,
            214, 56, 180, 38, 209, 45, 253, 58, 140, 17, 9, 165, 28, 157, 70,
            223, 159, 154, 179, 230, 29, 162, 182, 205, 169, 82, 205, 104, 157,
            76, 95, 231, 153, 164, 200, 230, 214, 244, 49, 81, 110, 213, 240,
            123, 187, 215, 164, 25, 99, 228, 132, 185, 191, 188, 175, 70, 181,
            82, 65, 177, 105, 0, 178, 13, 18, 128, 81, 89, 230, 28, 105, 35,
            159, 175, 145, 224, 65, 117, 118, 208, 133, 71, 179, 45, 74, 241,
            77, 207, 167, 205, 56, 42, 82, 225, 124, 91, 38, 116, 169, 24, 33,
            34, 55, 72, 126, 206, 183, 80, 90, 197, 235, 0, 254, 202, 55, 230,
            29, 144, 195, 44, 79, 24, 40, 77, 32, 72, 134, 179, 70, 147, 245,
            81, 169, 160, 167, 219, 178, 20, 213, 150, 225, 34, 247, 11, 70,
            53, 3, 70, 55, 229, 190, 14, 41, 184, 175, 127, 47, 176, 30, 15,
            126, 225, 6, 196, 201, 4, 7, 62, 107, 152, 236, 203, 211, 24, 139,
            3, 119, 38, 25, 254, 132, 72, 244, 231, 125, 185, 219, 127, 118,
            202, 90, 41, 178, 131, 47, 67, 28, 64, 29, 107, 249, 244, 191, 246,
            120, 93, 194, 249, 120, 131, 234, 216, 197, 150, 94, 79, 255, 40,
            222, 64, 51, 180, 47, 221, 8, 133, 154, 167, 88, 198, 230, 198,
            160, 193, 113, 168, 52, 52, 31, 225, 27, 10, 237, 177, 199, 219,
            27, 177, 142, 217, 26, 169, 41, 138, 219, 99, 152, 120, 138, 130,
            194, 116, 251, 2, 22, 9, 24, 124, 7, 192, 129, 127, 68, 183, 203,
            104, 250, 158, 66, 174, 104, 238, 242, 8, 232, 131, 105, 84, 5,
            207, 205, 180, 165, 137, 149, 225, 53, 229, 87, 197, 202, 213, 167,
            188, 249, 209, 67, 102, 223, 212, 223, 0, 88, 107, 153, 51, 201,
            120, 253, 232, 49, 212, 109, 110, 124, 103, 49, 204, 54, 33, 219,
            209, 23, 113, 106, 82, 64, 245, 40, 236, 120, 193, 6, 190, 155,
            248, 93, 87, 196, 214, 215, 156, 79, 196, 13, 200, 117, 7, 120, 51,
            162, 88, 41, 30, 164, 33, 40, 76, 241, 3, 252, 216, 135, 185, 160,
            131, 230, 224, 4, 242, 3, 208, 150, 154, 223, 163, 45, 3, 7, 201,
            235, 128, 195, 143, 227, 184, 189, 229, 238, 111, 151, 237, 227,
            110, 153, 135, 154, 203, 173, 128, 121, 219, 93, 234, 119, 244, 31,
            72, 29, 179, 7, 242, 219, 14, 95, 186, 13, 35, 28, 183, 96, 107,
            28, 184, 8, 82, 13, 155, 255, 9, 1, 232, 241, 50, 178, 94, 60, 38,
            234, 146, 250, 63, 216, 142, 133, 246, 90, 174, 69, 97, 204, 98,
            199, 68, 94, 34, 78, 58, 164, 85, 73, 173, 123, 220, 26, 220, 237,
            163, 134, 241, 140, 160, 16, 95, 21, 245, 76, 4, 209, 195, 44, 176,
            249, 102, 168, 6, 239, 67, 245, 161, 213, 128, 143, 65, 208, 78,
            71, 49, 3, 180, 128, 153, 162, 99, 85, 42, 75, 93, 220, 59, 66,
            207, 168, 250, 63, 193, 194, 231, 217, 69, 239, 43, 53, 86, 91,
            122, 238, 255, 211, 80, 234, 110, 155, 218, 180, 40, 4, 220, 231,
            112, 229, 164, 51, 150, 182, 133, 130, 225, 124, 152, 80, 96, 8,
            60, 2, 180, 212, 11, 98, 123, 44, 11, 210, 176, 163, 34, 74, 84,
            104, 13, 119, 226, 35, 28, 105, 204, 34, 154, 255, 10, 153, 186,
            113, 197, 69, 23, 92, 185, 142, 34, 188, 220, 54, 194, 153, 241,
            136, 163, 242, 31, 180, 86, 194, 9, 240, 12, 147, 18, 213, 250, 23,
            188, 209, 68, 73, 74, 55, 17, 67, 35, 155, 205, 108, 216, 225, 132,
            23, 13, 56, 106, 29, 99, 169, 3, 237, 76, 218, 65, 4, 108, 208, 15,
            246, 203, 160, 26, 252, 75, 164, 252, 128, 15, 227, 41, 59, 26,
            126, 62, 207, 235, 8, 4, 96, 87, 84, 101, 132, 106, 226, 236, 66,
            161, 165, 174, 55, 36, 79, 134, 244, 10, 94, 220, 148, 64, 195,
            157, 221, 150, 151, 175, 255, 93, 67, 140, 67, 67, 254, 83, 94,
            210, 80, 104, 89, 41, 110, 22, 43, 0, 50, 147, 246, 82, 202, 130,
            86, 70, 43, 144, 155, 3, 25, 22, 203, 54, 255, 116, 188, 79, 172,
            89, 119, 17, 234, 108, 191, 94, 89, 207, 41, 20, 6, 86, 223, 22,
            212, 176, 106, 132, 142, 162, 6, 133, 18, 248, 163, 127, 44, 86,
            231, 132, 108, 161, 118, 4, 250, 169, 97, 76, 1, 141, 45, 228, 202,
            144, 134, 174, 132, 15, 226, 152, 206, 188, 30, 210, 63, 162, 63,
            181, 92, 205, 94, 253, 236, 135, 107, 243, 252, 36, 226, 25, 21,
            146, 161, 222, 87, 205, 92, 69, 174, 211, 105, 30, 250, 164, 103,
            240, 98, 53, 206, 163, 124, 241, 55, 168, 12, 162, 102, 33, 228,
            171, 38, 31, 98, 95, 47, 53, 38, 2, 123, 79, 28, 31, 100, 97, 253,
            219, 99, 48, 23, 121, 149, 243, 219, 165, 142, 25, 43, 75, 223, 73,
            207, 114, 203, 81, 128, 115, 54, 34, 159, 24, 202, 190, 165, 212,
            173, 60, 37, 81, 62, 50, 54, 95, 133, 96, 116, 15, 7, 124, 76, 125,
            101, 135, 103, 174, 250, 191, 243, 99, 204, 25, 254, 206, 226, 178,
            13, 250, 95, 48, 224, 106, 37, 176, 156, 166, 72, 1, 46, 101, 209,
            145, 236, 33, 111, 131, 214, 40, 191, 118, 159, 131, 221, 7, 75, 6,
            60, 54, 237, 235, 123, 134, 37, 58, 237, 224, 153, 73, 160, 221,
            174, 8, 183, 105, 87, 19, 215, 250, 55, 128, 95, 236, 249, 59, 241,
            21, 204, 248, 175, 70, 168, 253, 39, 7, 189, 70, 41, 141, 98, 155,
            76, 118, 117, 71, 40, 182, 175, 23, 78, 17, 126, 197, 126, 240, 29,
            19, 9, 31, 138, 27, 123, 130, 47, 134, 197, 191, 221, 112, 120,
            189, 253, 160, 78, 168, 175, 85, 217, 5, 168, 102, 149, 193, 72,
            242, 7, 148, 196, 163, 202, 173, 39, 67, 49, 252, 46, 173, 35, 233,
            52, 8, 108, 166, 155, 37, 160, 127, 208, 2, 166, 252, 208, 11, 253,
            235, 254, 48, 1, 24, 171, 188, 170, 102, 152, 197, 122, 95, 155,
            251, 41, 49, 66, 11, 145, 148, 10, 26, 196, 152, 124, 240, 171,
            208, 41, 159, 225, 129, 56, 56, 159, 78, 219, 187, 65, 174, 183,
            208, 154, 116, 30, 54, 96, 188, 226, 33, 169, 208, 220, 125, 229,
            10, 210, 93, 86, 28, 167, 49, 165, 68, 94, 65, 30, 161, 52, 13, 84,
            89, 115, 234, 7, 28, 62, 153, 213, 185, 225, 74, 222, 148, 197, 20,
            248, 217, 235, 139, 233, 175, 170, 23, 189, 228, 197, 215, 142,
            116, 234, 11, 71, 87, 212, 106, 123, 62, 100, 117, 62, 87, 66, 111,
            248, 41, 251, 98, 253, 238, 3, 175, 228, 169, 50, 107, 174, 192,
            167, 36, 7, 76, 235, 91, 214, 244, 237, 6, 117, 160, 77, 115, 102,
            40, 5, 45, 37, 169, 251, 101, 202, 141, 24, 107, 7, 242, 207, 221,
            126, 7, 93, 117, 179, 5, 57, 75, 223, 62, 121, 154, 128, 92, 242,
            188, 150, 163, 48, 124, 187, 136, 36, 202, 168, 232, 206, 70, 197,
            136, 220, 186, 65, 132, 97, 197, 145, 76, 167, 132, 37, 30, 55, 3,
            99, 175, 105, 152, 80, 217, 199, 24, 29, 45, 12, 123, 73, 151, 205,
            175, 65, 90, 41, 181, 139, 212, 85, 129, 161, 128, 42, 223, 214,
            48, 123, 213, 125, 138, 206, 159, 190, 253, 81, 236, 68, 134, 199,
            125, 8, 17, 238, 29, 219, 218, 88, 51, 237, 75, 194, 57, 191, 65,
            92, 40, 141, 136, 31, 243, 118, 12, 138, 54, 218, 56, 158, 157,
            150, 42, 169, 249, 38, 225, 219, 197, 144, 37, 49, 26, 253, 65, 54,
            7, 157, 202, 126, 165, 242, 132, 190, 110, 167, 142, 80, 42, 248,
            146, 63, 124, 149, 27, 221, 255, 76, 167, 169, 141, 85, 140, 47,
            240, 0, 189, 100, 185, 104, 248, 11, 101, 221, 44, 67, 53, 128,
            147, 157, 106, 62, 139, 17, 31, 124, 124, 40, 175, 23, 163, 32,
            132, 111, 182, 102, 153, 28, 122, 192, 107, 158, 22, 98, 171, 190,
            88, 91, 244, 84, 12, 147, 17, 47, 133, 166, 99, 33, 184, 194, 106,
            200, 78, 114, 187, 90, 160, 4, 38, 218, 35, 153, 212, 201, 212,
            197, 194, 122, 80, 7, 155, 11, 167, 228, 195, 90, 143, 204, 17, 11,
            172, 235, 85, 109, 31, 146, 30, 112, 79, 232, 221, 30, 1, 163, 20,
            31, 116, 24, 28, 96, 186, 209, 139, 78, 71, 194, 166, 16, 146, 151,
            186, 231, 213, 188, 209, 224, 45, 82, 236, 80, 170, 243, 219, 102,
            207, 69, 179, 160, 214, 248, 227, 89, 195, 243, 21, 72, 30, 125,
            31, 125, 215, 186, 207, 204, 143, 101,
        ]
        .to_vec();

        let (_metadata_msg, info) = Metadata::extract(buf).unwrap();

        assert_eq!(info.len(), 5205);
    }
}