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

Sources/ucode/tests/custom/03_stdlib/48_b64dec

  1 The `b64dec()` function decodes the given base64 input string.
  2 
  3 Returns a string containing the decoded data.
  4 
  5 Returns `null` if the input is not a string or if the input string was
  6 invalid base64 data (e.g. missing padding or non-whitespace characters
  7 outside the expected alphabet).
  8 
  9 -- Testcase --
 10 {%
 11         printf("%.J\n", [
 12                 b64dec("SGVsbG8sIHdvcmxkIQ=="),
 13                 b64dec("SGVsbG8sIHdvcmxkIQ"),
 14                 b64dec("AAECAw=="),
 15                 b64dec("xxx"),
 16                 b64dec("==="),
 17                 b64dec(true)
 18         ]);
 19 %}
 20 -- End --
 21 
 22 -- Expect stdout --
 23 [
 24         "Hello, world!",
 25         null,
 26         "\u0000\u0001\u0002\u0003",
 27         null,
 28         null,
 29         null
 30 ]
 31 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt