示例#1
0
def test_encode_high():

    # High level encoding
    expected = [
        130, 227, 637, 601, 843, 25, 479, 227, 328, 765, 902, 1, 624, 142, 113,
        522, 200, 900, 865, 479, 267, 630, 416, 868, 237, 1, 613, 130, 865, 479,
        567, 21, 550, 26, 64, 559, 26, 841, 115, 479, 841, 0, 0, 808, 777, 6, 514,
        58, 765, 871, 818, 206, 868, 177, 258, 236, 868, 567, 425, 592, 17, 146,
        118, 537, 448, 537, 448, 535, 479, 567, 21, 550, 26, 64, 559, 26, 841, 115,
        479, 841, 0, 0, 808, 777, 6, 514, 58, 765, 877, 539, 902, 31, 251, 786, 557,
        565, 1, 372, 900, 865, 479, 840, 25, 479, 227, 841, 63, 125, 205, 479, 13,
        588, 865, 479, 537, 25, 644, 296, 450, 304, 570, 805, 26, 30, 536, 314, 104,
        634, 865, 479, 73, 714, 436, 412, 39, 661, 428, 120
    ]

    assert encode_high(to_bytes(TEST_DATA), 6, 2) == expected
示例#2
0
 def do_compact(str):
     return list(compact_text_interim(to_bytes(str)))
示例#3
0
 def do_compact(str):
     return list(compact_bytes(to_bytes(str)))
示例#4
0
 def do_compact(str):
     return list(compact(to_bytes(str), numeric_compaction=True))