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