|
14 | 14 |
|
15 | 15 | B2 = {r'': "01", r'[-_]inv(erted)?': "10"} |
16 | 16 | base2n(B2, r"^(?:base[-_]?2|bin)(|[-_]inv(?:erted)?|[-_][a-zA-Z0-9]{2})$") |
| 17 | +main2 = main(2) |
17 | 18 |
|
18 | 19 |
|
19 | 20 | B3 = {r'': "123", r'[-_]inv(erted)?': "321"} |
20 | 21 | base(B3, r"^base[-_]?3(|[-_]inv(?:erted)?|[-_][a-zA-Z0-9]{3})$") |
| 22 | +main3 = main(3) |
21 | 23 |
|
22 | 24 |
|
23 | 25 | B4 = {r'': "1234", r'[-_]inv(erted)?': "4321"} |
24 | 26 | base2n(B4, r"^base[-_]?4(|[-_]inv(?:erted)?|[-_][a-zA-Z0-9]{4})$") |
| 27 | +main4 = main(4) |
25 | 28 |
|
26 | 29 |
|
27 | 30 | B8 = {r'': "abcdefgh", r'[-_]inv(erted)?': "hgfedcba"} |
28 | 31 | base2n(B8, r"^base[-_]?8(|[-_]inv(?:erted)?|[-_][a-zA-Z0-9]{8})$") |
| 32 | +main8 = main(8) |
29 | 33 |
|
30 | 34 |
|
31 | 35 | B16 = {'': digits + "ABCDEF", 'inv': "ABCDEF" + digits} |
|
39 | 43 | r'(?:[-_]ext(?:ended)?)?[-_]hex$': digits + upper[:22], |
40 | 44 | r'[-_]geohash': digits + "bcdefghjkmnpqrstuvwxyz", |
41 | 45 | } |
42 | | -base2n(B32, r"^base[-_]?32(|[-_]inv(?:erted)?|(?:[-_]ext(?:ended)?)?[-_]hex|[-_]geohash)$", padding_char="=") |
| 46 | +base2n(B32, r"^base[-_]?32(|[-_]inv(?:erted)?|(?:[-_]ext(?:ended)?)?[-_]hex|[-_]geohash)$", padding_char="=", |
| 47 | + guess=["base32", "base32-inv", "base32-ext", "base32-geohash"]) |
| 48 | +main32 = main(32, "RFC 4648") |
| 49 | +main32ext = main(32, "RFC 4648", "extended", False) |
| 50 | +main32geo = main(32, "RFC 4648", "geohash", False) |
| 51 | + |
| 52 | + |
43 | 53 | ZB32 = {'': "ybndrfg8ejkmcpqxot1uwisza345h769"} |
44 | 54 | base2n(ZB32, r"^z[-_]?base[-_]?32$", name="zbase32", padding_char="=") |
| 55 | +mainz32 = main(32, "<https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt>", "z", False) |
45 | 56 |
|
46 | 57 |
|
47 | 58 | B36 = {'': digits + upper, 'inv': upper + digits} |
|
54 | 65 | r'[-_](rp|ripple)$': "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz", |
55 | 66 | r'[-_](fl|flickr|short[-]?url|url)$': "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", |
56 | 67 | } |
57 | | -base(B58, r"^base[-_]?58(|[-_](bc|bitcoin|rp|ripple|fl|flickr|short[-]?url|url))$") |
58 | | -main58bc = main(58, "<https://en.bitcoinwiki.org/wiki/Base58>", "-bitcoin") |
59 | | -main58rp = main(58, "<https://en.bitcoinwiki.org/wiki/Base58>", "-ripple") |
60 | | -main58fl = main(58, "<https://en.bitcoinwiki.org/wiki/Base58>", "-flickr") |
| 68 | +base(B58, r"^base[-_]?58(|[-_](bc|bitcoin|rp|ripple|fl|flickr|short[-]?url|url))$", |
| 69 | + guess=["base58-bitcoin", "base58-ripple", "base58-flickr"]) |
| 70 | +main58bc = main(58, "<https://en.bitcoinwiki.org/wiki/Base58>", "bitcoin") |
| 71 | +main58rp = main(58, "<https://en.bitcoinwiki.org/wiki/Base58>", "ripple") |
| 72 | +main58fl = main(58, "<https://en.bitcoinwiki.org/wiki/Base58>", "flickr") |
61 | 73 |
|
62 | 74 |
|
63 | 75 | B62 = {'': digits + upper + lower, 'inv': digits + lower + upper} |
|
75 | 87 | r'[-_]inv(erted)?$': lower + upper + digits + "+/", |
76 | 88 | r'[-_]?(file|url)(safe)?$': upper + lower + digits + "-_", |
77 | 89 | } |
78 | | -base2n(B64, r"^base[-_]?64(|[-_]inv(?:erted)?|[-_]?(?:file|url)(?:safe)?)$", padding_char="=") |
| 90 | +base2n(B64, r"^base[-_]?64(|[-_]inv(?:erted)?|[-_]?(?:file|url)(?:safe)?)$", padding_char="=", |
| 91 | + guess=["base64", "base64-inv", "base64-url"]) |
| 92 | +main64 = main(64, "RFC 4648") |
| 93 | +main64url = main(64, "RFC 4648 / Base64URL", "url", False) |
79 | 94 |
|
80 | 95 |
|
81 | 96 | B67 = { |
|
0 commit comments