mirror of https://github.com/svaarala/duktape.git
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.
29 lines
562 B
29 lines
562 B
name: duk_hex_decode
|
|
|
|
proto: |
|
|
void duk_hex_decode(duk_context *ctx, duk_idx_t idx);
|
|
|
|
stack: |
|
|
[ ... hex_val! ... ] -> [ ... val! ... ]
|
|
|
|
summary: |
|
|
<p>Decodes a hex encoded value into a buffer as an in-place operation.
|
|
If the input is invalid, throws an error.</p>
|
|
|
|
example: |
|
|
duk_push_string(ctx, "7465737420737472696e67");
|
|
duk_hex_decode(ctx, -1); /* buffer */
|
|
printf("hex decoded: %s\n", duk_to_string(ctx, -1));
|
|
duk_pop(ctx);
|
|
|
|
/* Output:
|
|
* hex decoded: test string
|
|
*/
|
|
|
|
tags:
|
|
- codec
|
|
|
|
seealso:
|
|
- duk_hex_encode
|
|
|
|
introduced: 1.0.0
|
|
|