# paste.ha -rw-r--r-- 347 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use bufio;
use encoding::base64;
use fmt;
use io;
use os;
use strings;

export fn main() void = {
	let buf: [32]u8 = [0...];
	let sink = bufio::fixed(buf, io::mode::WRITE);

	const data = strings::toutf8("Hello, world!");
	base64::encode(&sink, &base64::std_encoding, data)!;
	io::writeall(os::stdout, bufio::buffer(&sink))!;
	fmt::println()!;
};