• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/03_stdlib/57_hexenc

  1 The `hexenc()` function encodes the given byte string into a hexadecimal
  2 digit string, converting the input value to a string if needed.
  3 
  4 Returns the encoded hexadecimal digit string.
  5 
  6 -- Testcase --
  7 {%
  8         printf("%.J\n", [
  9                 hexenc("Hello world!\n"),       // encoding a simple string
 10                 hexenc(""),                             // empty input -> empty output
 11                 hexenc([1, 2, 3]),              // implicit stringification
 12                 hexenc(null),                           // null input -> null output
 13         ]);
 14 %}
 15 -- End --
 16 
 17 -- Expect stdout --
 18 [
 19         "48656c6c6f20776f726c64210a",
 20         "",
 21         "5b20312c20322c2033205d",
 22         null
 23 ]
 24 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt