| 1 | const std = @import("std"); |
| 2 | const string = []const u8; |
| 3 | const extras = @import("./lib.zig"); |
| 4 | |
| 5 | pub fn base64EncodeAlloc(alloc: std.mem.Allocator, input: string) !string { |
| 6 | const base64 = std.base64.standard.Encoder; |
| 7 | const buf = try alloc.alloc(u8, base64.calcSize(input.len)); |
| 8 | return base64.encode(buf, input); |
| 9 | } |
| 10 | |
| 11 | test { |
| 12 | std.testing.refAllDecls(@This()); |
| 13 | } |