pub fn version_check_encode(
	version: AddressVersion,
	data: impl AsRef<[u8]>,
) -> String {
	let data = data.as_ref();

	let mut buffer = vec![version as u8];
	buffer.extend_from_slice(data);

	let checksum = DoubleSha256Hasher::new(&buffer).checksum();
	buffer.extend_from_slice(&checksum);

	let mut encoded = encode(&buffer[1..]);
	encoded.insert(0, C32_ALPHABET[version as usize] as char);

	encoded
}
C32 encode the given data with a version check
stacks-core/src/c32.rs