https://github.com/0xflotus/rfc1924
Implementation of RFC 1924 to get a compact representation of IPv6 addresses
https://github.com/0xflotus/rfc1924
compact hacktoberfest hacktoberfest-accepted ipv6 rfc1924
Last synced: 3 months ago
JSON representation
Implementation of RFC 1924 to get a compact representation of IPv6 addresses
- Host: GitHub
- URL: https://github.com/0xflotus/rfc1924
- Owner: 0xflotus
- License: mit
- Created: 2023-01-09T11:51:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-10-07T10:05:33.000Z (9 months ago)
- Last Synced: 2025-12-15T07:53:48.739Z (6 months ago)
- Topics: compact, hacktoberfest, hacktoberfest-accepted, ipv6, rfc1924
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RFC 1924
This python library is an implementation of [RFC 1924](https://www.rfc-editor.org/rfc/rfc1924).
## A Compact Representation of IPv6 Addresses
With this library you can store IPv6 addresses in a more compact form. It's Base85 encoded.
## Usage
```py
from rfc1924 import encode, decode
print(encode("2345:0425:2CA1::0567:5673:23b5")) # -> AN?6(i3Y+yVr74uX@J3P
print(decode("AN?6(i3Y+yVr74uX@J3P")) # -> 2345:0425:2CA1::0567:5673:23b5
```
Save up to 48% space with this compact form:
`ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff` -> `=r54lj&NUUO~Hi%c2ym0`