mirror of
https://git.photon.obnh.io/AXSY/whois.git
synced 2026-03-15 02:43:39 +00:00
Initial commit: mwhois with SCION AS support and decimal AS conversion
Based on mwhois by Antonios A. Chariton Modifications for SCION AS support by Olaf Baumert, Axpo Systems AG
This commit is contained in:
33
netaddr/tests/2.x/ip/rfc1924.txt
Normal file
33
netaddr/tests/2.x/ip/rfc1924.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
=RFC 1924 Tests=
|
||||
|
||||
Copyright (c) 2008-2015, David P. D. Moss. All rights reserved.
|
||||
|
||||
The example from the RFC.
|
||||
|
||||
{{{
|
||||
|
||||
>>> from netaddr.ip.rfc1924 import ipv6_to_base85, base85_to_ipv6
|
||||
|
||||
>>> ip_addr = '1080::8:800:200c:417a'
|
||||
|
||||
>>> ip_addr
|
||||
'1080::8:800:200c:417a'
|
||||
|
||||
>>> base85 = ipv6_to_base85(ip_addr)
|
||||
|
||||
>>> base85
|
||||
'4)+k&C#VzJ4br>0wv%Yp'
|
||||
|
||||
RFC specifies that "leading zeroes are never omitted"
|
||||
>>> ipv6_to_base85("::1")
|
||||
'00000000000000000001'
|
||||
|
||||
>>> base85_to_ipv6(base85)
|
||||
'1080::8:800:200c:417a'
|
||||
|
||||
Invalid length for a base85 encoded IPv6 address
|
||||
>>> base85_to_ipv6('not 20 chars')
|
||||
Traceback (most recent call last):
|
||||
AddrFormatError: Invalid base 85 IPv6 address: 'not 20 chars'
|
||||
|
||||
}}}
|
||||
Reference in New Issue
Block a user