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