fork of indigo with slightly nicer lexgen
at main 1.2 kB view raw
1# throws on invalid handles 2did:thing.test 3did:thing 4john-.test 5john.0 6john.- 7xn--bcher-.tld 8john..test 9jo_hn.test 10-john.test 11.john.test 12jo!hn.test 13jo%hn.test 14jo&hn.test 15jo@hn.test 16jo*hn.test 17jo|hn.test 18jo:hn.test 19jo/hn.test 20john💩.test 21bücher.test 22john .test 23john.test. 24john 25john. 26.john 27john.test. 28.john.test 29 john.test 30john.test 31joh-.test 32john.-est 33john.tes- 34 35# max over all handle: 'shoooort' + '.loooooooooooooooooooooooooong'.repeat(9) + '.test' 36shoooort.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.loooooooooooooooooooooooooong.test 37 38# max segment: 'short.' + 'o'.repeat(64) + '.test' 39short.oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo.test 40 41# throws on "dotless" TLD handles 42org 43ai 44gg 45io 46 47# correctly validates corner cases (modern vs. old RFCs) 48cn.8 49thing.0aa 50thing.0aa 51 52# does not allow IP addresses as handles 53127.0.0.1 54192.168.0.142 55fe80::7325:8a97:c100:94b 562600:3c03::f03c:9100:feb0:af1f 57 58# examples from stackoverflow 59-notvalid.at-all 60-thing.com 61www.masełkowski.pl.com