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 be NULL).
  • 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 πŸ’…πŸ’–