jose_b64(3)
π jose_b64 β URL-safe Base64 Encoding & Decoding π
okay bestie, welcome to the jose_b64(3) page, straight out of the Library Functions Manual π. this is the lil corner of JosΓ© that does all the Base64 glow-ups β URL-safe flavored, obviously. no + and / nonsense here, we're being web-friendly π
β¨ NAME β¨
jose_b64 β URL-safe Base64 Encoding & Decoding. that's it, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
π«Ά Functions
here's the whole squad, and no we are not skipping a single one:
size_t jose_b64_dec (const json_t *i, void *o, size_t ol)β Decodes a URL-safe Base64 JSON string to a buffer.jose_io_t * jose_b64_dec_io (jose_io_t *next)β Creates a new IO object which performs URL-safe Base64 decoding.size_t jose_b64_dec_buf (const void *i, size_t il, void *o, size_t ol)β Decodes a URL-safe Base64 buffer to an output buffer.json_t * jose_b64_dec_load (const json_t *i)β Decodes a JSON string from a URL-safe Base64 JSON string.json_t * jose_b64_enc (const void *i, size_t il)β Encodes data to a URL-safe Base64 JSON string.jose_io_t * jose_b64_enc_io (jose_io_t *next)β Creates a new IO object which performs URL-safe Base64 encoding.size_t jose_b64_enc_buf (const void *i, size_t il, void *o, size_t ol)β Encodes data to a URL-safe Base64 buffer.json_t * jose_b64_enc_dump (const json_t *i)β Encodes the input JSON as a URL-safe Base64 JSON string.
π Detailed Description π
URL-safe Base64 Encoding & Decoding.
like. that's the entire description. it does the thing, it does it URL-safely, and it does it well. main character behavior honestly π
π Function Documentation π
size_t jose_b64_dec (const json_t * i, void * o, size_t ol)
Decodes a URL-safe Base64 JSON string to a buffer. If o is NULL, the number of output bytes necessary is returned. peak "just tell me how much room I need" energy β¨
This function will never write more than ol bytes. If the output buffer is too small, an error will occur. no sneaky buffer overflow over here, she respects the boundaries fr fr π«Ά
Parameters:
iβ The input URL-safe Base64 JSON string.oβ The output buffer (may beNULL).olβ The size of the output buffer.
Returns:
The number of bytes that were (or would be) written. If an error occurs, SIZE_MAX is returned. yeah, SIZE_MAX is the "we don't talk about it" signal π
jose_io_t* jose_b64_dec_io (jose_io_t * next)
Creates a new IO object which performs URL-safe Base64 decoding. All data written to the returned IO object will be decoded before passing it on to the next IO object in the chain. it's giving relay race, but make it cryptography πββοΈ
Parameters:
nextβ The next IO object in the chain.
Returns:
The new IO object or NULL on error.
size_t jose_b64_dec_buf (const void * i, size_t il, void * o, size_t ol)
Decodes a URL-safe Base64 buffer to an output buffer. If o is NULL, the number of output bytes necessary is returned. same trick as before, and honestly? iconic π
This function will never write more than ol bytes. If the output buffer is too small, an error will occur.
Parameters:
iβ The input URL-safe Base64 buffer.ilβ The size of the data in the input buffer.oβ The output buffer.olβ The size of the output buffer.
Returns:
The number of bytes that were (or would be) written. If an error occurs, SIZE_MAX is returned.
json_t* jose_b64_dec_load (const json_t * i)
Decodes a JSON string from a URL-safe Base64 JSON string. un-base64 it and hand you back actual JSON, chef's kiss πβ¨
Parameters:
iβ The input URL-safe Base64 JSON string containing JSON data.
Returns:
The output JSON data.
json_t* jose_b64_enc (const void * i, size_t il)
Encodes data to a URL-safe Base64 JSON string. the glow-up direction of the operation, so to speak πΈ
Parameters:
iβ The input buffer.ilβ The size of the data in the input buffer.
Returns:
The decoded JSON data. If an error occurs, NULL is returned.
yes bestie, the docs literally say "The decoded JSON data" for the encoder β we are not fixing it, we are reporting it verbatim, no cap π
jose_io_t* jose_b64_enc_io (jose_io_t * next)
Creates a new IO object which performs URL-safe Base64 encoding. All data written to the returned IO object will be encoded before passing it on to the next IO object in the chain. same chain gang situation as the decoder, opposite direction π₯
Parameters:
nextβ The next IO object in the chain.
Returns:
The new IO object or NULL on error.
size_t jose_b64_enc_buf (const void * i, size_t il, void * o, size_t ol)
Encodes data to a URL-safe Base64 buffer. If o is NULL, the number of output bytes necessary is returned. the "how much room do I need" move again, we love consistency π
This function will never write more than ol bytes. If the output buffer is too small, an error will occur.
Parameters:
iβ The input buffer.ilβ The size of the data in the input buffer.oβ The output URL-safe Base64 buffer.olβ The size of the output buffer.
Returns:
The number of bytes that were (or would be) written. If an error occurs, SIZE_MAX is returned.
json_t* jose_b64_enc_dump (const json_t * i)
Encodes the input JSON as a URL-safe Base64 JSON string. JSON in, cute lil Base64 string out, periodt β
Parameters:
iβ The input JSON data.
Returns:
The output URL-safe Base64 JSON string.
π Author π
Generated automatically by Doxygen for JosΓ© from the source code. so like, a robot wrote this, and I just gave it a personality π
and that's a wrap, babe π«Ά this was jose_b64(3) from the JosΓ© library, dated Tue May 30 2017 β oldie but a goldie, still serving URL-safe realness. go encode something and make it β¨secureβ¨, ily, bye π
π
π¦ where this page comes from
- alpine 3.24: jose-doc 14-r0 Β· Apache-2.0
- arch rolling: jose 15-2 Β· Apache-2.0
- centos-stream 10: libjose-devel 14-102.el10 Β· Apache-2.0
- centos-stream 9: libjose-devel 14-1.el9 Β· ASL 2.0
- centos-stream 9: libjose-devel 14-1.el9 Β· ASL 2.0
- debian bookworm: libjose-dev 11-2+deb12u1 Β· Apache-2.0
- debian trixie: libjose-dev 14-2 Β· Apache-2.0
- fedora 43: libjose-devel 14-5.fc43 Β· Apache-2.0
- fedora 43: libjose-devel 14-5.fc43 Β· Apache-2.0
- fedora 44: libjose-devel 14-6.fc44 Β· Apache-2.0
- fedora 44: libjose-devel 14-6.fc44 Β· Apache-2.0
- nixpkgs unstable: jose 14
- opensuse-leap 16.0: libjose0 13-bp160.1.14 Β· Apache-2.0
- opensuse-leap 16.0: libjose0 13-bp160.1.14 Β· Apache-2.0
- opensuse-leap 16.0: libjose0 13-bp160.1.14 Β· Apache-2.0
- opensuse-leap 16.0: libjose0 13-bp160.1.14 Β· Apache-2.0
- ubuntu jammy: libjose-dev 11-2 Β· Apache-2.0
- ubuntu noble: libjose-dev 13-1 Β· Apache-2.0
- ubuntu resolute: libjose-dev 14-2build1 Β· Apache-2.0
- ubuntu stonking: libjose-dev 14-2build2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms