Skip to content

Instantly share code, notes, and snippets.

@sipa
sipa / golomb_loss.md
Last active July 30, 2023 18:25
Minimizing the redundancy in Golomb Codes Sets
@sipa
sipa / buildmap.py
Created August 24, 2019 09:04
asmap build script
import sys
import re
import ipaddress
# This program loads AS mapping entries from stdin in the form "[IP]/[bits] AS[num]", where IP is an IPv4
# or IPv6 address, bits is an integer between 0 and 32 (for IPv4) or 128 (for IPv6), and num is an integer
# between 1 and 16777215.
def Parse(entries):
for line in sys.stdin: