authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-14 19:07:27-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
logaf730c64bd760a2fee7418b5d4b8912e3aec4eed
tree2c1c7d2111da7dc13fdf6f5d67123367186f8820
parentd770dae1b8ad385d47ec716ab23eca8ca92c31d5

Put base64 alphabet into a named constant


1 files changed, 7 insertions(+), 11 deletions(-)

lib/std/fs.zig+7-11
......@@ -49,17 +49,13 @@ pub const MAX_PATH_BYTES = switch (builtin.os.tag) {
4949 else => @compileError("Unsupported OS"),
5050};
5151
52/// Base64, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.
53pub const base64_encoder = base64.Base64Encoder.init(
54 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
55 base64.standard_pad_char,
56);
57
58/// Base64, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.
59pub const base64_decoder = base64.Base64Decoder.init(
60 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
61 base64.standard_pad_char,
62);
52pub const base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
53
54/// Base64 encoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.
55pub const base64_encoder = base64.Base64Encoder.init(base64_alphabet, base64.standard_pad_char);
56
57/// Base64 decoder, replacing the standard `+/` with `-_` so that it can be used in a file name on any filesystem.
58pub const base64_decoder = base64.Base64Decoder.init(base64_alphabet, base64.standard_pad_char);
6359
6460/// Whether or not async file system syscalls need a dedicated thread because the operating
6561/// system does not support non-blocking I/O on the file system.