Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

decode

Public Function
std.crypto.codecs.base64_hex_ct.base64.decode
pub fn decode(bin: []u8, encoded: []const u8, comptime variant: Variant) error

Decodes a base64 string into a binary buffer. The output buffer must be at least decodedLenUpperBound(encoded.len) bytes long.

Params

  • bin: []u8
  • encoded: []const u8
  • variant: Variant

File

crypto/codecs/base64_hex_ct.zig:227
227
228
229
230
231
232
233
234
    pub fn decode(bin: []u8, encoded: []const u8, comptime variant: Variant) error{ InvalidCharacter, InvalidPadding }![]const u8 {
        return decodeAny(bin, encoded, variant, null) catch |err| {
            switch (err) {
                error.InvalidCharacter, error.InvalidPadding => |e| return e,
                else => unreachable,
            }
        };
    }