def key_to_name(k): assert not k.has_private() x = intdigest(ripemd160(key_to_string(k))) n = natural_to_string(x * c1 + c2, dns_alphabet) return n
def key_to_name_hash(k): assert not k.has_private() nh = ripemd160(key_to_string(k)).digest() assert len(nh) == 160 // 8 return nh