We decode case insentively but encode using the specified alphabet, which is upper-cased only.
#include "common.h"
#include <glib.h>
#include <string.h>
#include "base32.h"
#include "override.h"
Functions | |
RCSID ("$Id:base32.c, v 1.5 2005/06/29 14:24:26 daichik Exp $") | |
gint | encode_pad_length (gint len, gint *pad) |
Compute the number of base32 digits and amount of padding necessary to encode `len' bytes. | |
void | base32_encode_exactly (const gchar *buf, guint len, gchar *encbuf, gint enclen) |
Encode `len' bytes from `buf' into `enclen' bytes starting from `encbuf'. | |
void | base32_encode_into (const gchar *buf, gint len, gchar *encbuf, gint enclen) |
Encode `len' bytes from `buf' into `enclen' bytes starting from `encbuf'. | |
void | base32_encode_str_into (const gchar *buf, gint len, gchar *encbuf, gint enclen, gboolean padding) |
Encode `len' bytes from `buf' into `enclen' bytes starting from `encbuf'. | |
gchar * | base32_encode (const gchar *buf, gint len, gint *retpad, gboolean padding) |
Encode `len' bytes starting at `buf' into new allocated buffer. | |
gint | base32_decode_alphabet (const gint8 valmap[256], const gchar *buf, gint len, gchar *decbuf, gint declen, gint padding) |
Decode `len' bytes from `buf' into `declen' bytes starting from `decbuf'. | |
gint | base32_decode_into (const gchar *buf, gint len, gchar *decbuf, gint declen) |
Decode `len' bytes from `buf' into `declen' bytes starting from `decbuf', faking the necessary amount of padding if necessary. | |
gint | base32_decode_old_into (const gchar *buf, gint len, gchar *decbuf, gint declen) |
Decode `len' bytes from `buf' into `declen' bytes starting from `decbuf'. | |
gchar * | base32_decode (const gchar *buf, gint len, gint *outlen) |
Decode `len' bytes starting at `buf' into new allocated buffer. | |
Variables | |
const gint8 | values [256] |
const gchar * | b32_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" |
const gint8 | old_values [256] |
Older base32 alphabet: "ABCDEFGHIJK MN PQRSTUVWXYZ 23456789" We decode it only. |
|
Decode `len' bytes starting at `buf' into new allocated buffer.
|
|
Decode `len' bytes from `buf' into `declen' bytes starting from `decbuf'. Caller must have ensured that there was sufficient room in decbuf. Uses the specified decoding alphabet. `padding', when non-zero, is the amount of padding that is missing from the input buffer and which we must assume.
|
|
Decode `len' bytes from `buf' into `declen' bytes starting from `decbuf', faking the necessary amount of padding if necessary. Caller must have ensured that there was sufficient room in decbuf.
|
|
Decode `len' bytes from `buf' into `declen' bytes starting from `decbuf'. faking the necessary amount of padding if necessary. Caller must have ensured that there was sufficient room in decbuf. The "old" base32 alphabet is used for decoding.
|
|
Encode `len' bytes starting at `buf' into new allocated buffer. Trailing padding chars are emitted when `padding' is TRUE.
|
|
Encode `len' bytes from `buf' into `enclen' bytes starting from `encbuf'. Caller must have ensured that there was EXACTLY the needed room in encbuf. |
|
Encode `len' bytes from `buf' into `enclen' bytes starting from `encbuf'. Trailing padding chars are emitted. Caller must have ensured that there was enough room in encbuf.
|
|
Encode `len' bytes from `buf' into `enclen' bytes starting from `encbuf'. Trailing padding chars are emitted when `padding' is TRUE. A trailing NUL is emitted at the end of the encoded buffer. Caller must have ensured that there was enough room in encbuf. |
|
Compute the number of base32 digits and amount of padding necessary to encode `len' bytes.
|
|
|
|
|
|
Older base32 alphabet: "ABCDEFGHIJK MN PQRSTUVWXYZ 23456789" We decode it only.
|
|
|