Skip to content

Commit

Permalink
add docs for std.base64
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Nov 14, 2017
1 parent 5029322 commit 7a74dba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions std/base64.zig
Expand Up @@ -7,6 +7,7 @@ pub fn encode(dest: []u8, source: []const u8) -> []u8 {
return encodeWithAlphabet(dest, source, standard_alphabet);
}

/// invalid characters in source are allowed, but they cause the value of dest to be undefined.
pub fn decode(dest: []u8, source: []const u8) -> []u8 {
return decodeWithAlphabet(dest, source, standard_alphabet);
}
Expand Down Expand Up @@ -59,6 +60,7 @@ pub fn encodeWithAlphabet(dest: []u8, source: []const u8, alphabet: []const u8)
return dest[0..out_index];
}

/// invalid characters in source are allowed, but they cause the value of dest to be undefined.
pub fn decodeWithAlphabet(dest: []u8, source: []const u8, alphabet: []const u8) -> []u8 {
assert(alphabet.len == 65);

Expand Down

0 comments on commit 7a74dba

Please sign in to comment.