authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-11-15 22:32:23-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-11-15 22:32:23-05:00
loga984040faecab4fed4fc5e36e44d5ec352b7a098
tree1f86151c1381dd580d1e3061e32bc9a36515e61f
parent371e578151b1bc402d766ace161cfb4e06777db6
parent7a74dbadd79d2b26a449027dd83753ae4d2a8032

Merge remote-tracking branch 'origin/master' into llvm6


1 files changed, 2 insertions(+), 0 deletions(-)

std/base64.zig+2
...@@ -7,6 +7,7 @@ pub fn encode(dest: []u8, source: []const u8) -> []u8 {...@@ -7,6 +7,7 @@ pub fn encode(dest: []u8, source: []const u8) -> []u8 {
7 return encodeWithAlphabet(dest, source, standard_alphabet);7 return encodeWithAlphabet(dest, source, standard_alphabet);
8}8}
99
10/// invalid characters in source are allowed, but they cause the value of dest to be undefined.
10pub fn decode(dest: []u8, source: []const u8) -> []u8 {11pub fn decode(dest: []u8, source: []const u8) -> []u8 {
11 return decodeWithAlphabet(dest, source, standard_alphabet);12 return decodeWithAlphabet(dest, source, standard_alphabet);
12}13}
...@@ -59,6 +60,7 @@ pub fn encodeWithAlphabet(dest: []u8, source: []const u8, alphabet: []const u8)...@@ -59,6 +60,7 @@ pub fn encodeWithAlphabet(dest: []u8, source: []const u8, alphabet: []const u8)
59 return dest[0..out_index];60 return dest[0..out_index];
60}61}
6162
63/// invalid characters in source are allowed, but they cause the value of dest to be undefined.
62pub fn decodeWithAlphabet(dest: []u8, source: []const u8, alphabet: []const u8) -> []u8 {64pub fn decodeWithAlphabet(dest: []u8, source: []const u8, alphabet: []const u8) -> []u8 {
63 assert(alphabet.len == 65);65 assert(alphabet.len == 65);
6466