You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
685 B

=proto
const char *duk_base64_encode(duk_context *ctx, int index);
=stack
[ ... val! ... ] -> [ ... base64_val! ... ]
=summary
<p>Coerces an arbitrary value into a buffer and then encodes the result
into base-64 as an in-place operation. Returns pointer to the resulting
string for convenience.</p>
<div class="note">
Coercing to a buffer first coerces a non-buffer value into a string, and
then coerces the string into a buffer. The resulting buffer contains the
string in CESU-8 encoding.
</div>
=example
duk_push_string(ctx, "foo");
printf("base-64 encoded: %s\n", duk_base64_encode(ctx, -1));
/* Output:
* base-64 encoded: Zm9v
*/
=tags
codec
=seealso
duk_base64_decode