Crates.io | bubblebabble |
lib.rs | bubblebabble |
version | 0.1.2 |
source | src |
created_at | 2019-11-30 15:13:25.122357 |
updated_at | 2019-11-30 16:07:11.320184 |
description | The Bubble Babble Binary Data Encoding |
homepage | |
repository | https://github.com/reyk/bubblebabble-rs |
max_upload_size | |
id | 185547 |
size | 16,582 |
Convert bytes
to the "Bubble Babble" data encoding that was defined
as a mechanism to encode SSH public key fingerprints in a
human-readable format.
use bubblebabble::*;
use std::net::Ipv6Addr;
// Convert 128-bit binary to bubblebabble
let data = [
0x2a, 0x0a, 0xe5, 0xc0, 0, 0x2, 0, 0x5, 0x5c, 0xf9, 0xcc, 0xc8, 0x7c, 0x48, 0x97, 0xc0,
];
let babble = bubblebabble(&data);
assert_eq!(babble, "xepib-panus-bubub-dubyb-hilyz-nefas-myzug-mihos-bexux");
// Convert IPv6 address to stablebabble
let localhost: Ipv6Addr = "::1".parse().unwrap();
let babbleaddr = stablebabble(&localhost.octets());
assert_eq!(babbleaddr, "xebab-7wa-caxax");
The Bubble Babble Binary Data Encoding, Antti Huima, 2011
Licensed under a BSD-style license, see LICENSE for details.