mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Add EncodeHex() and DecodeHex() to Redbean
This commit is contained in:
parent
00acd81b2f
commit
a186143f62
9 changed files with 97 additions and 13 deletions
|
@ -47,6 +47,9 @@ assert(hex(0x1940efe9d47ae889) == "0x1940efe9d47ae889")
|
|||
assert(oct(0x1940efe9d47ae889) == "0145007376472436564211")
|
||||
assert(bin(0x1940efe9d47ae889) == "0b0001100101000000111011111110100111010100011110101110100010001001")
|
||||
|
||||
assert(EncodeHex("\1\2\3\4\255") == "01020304ff")
|
||||
assert(DecodeHex("01020304ff") == "\1\2\3\4\255")
|
||||
|
||||
assert(EscapeHtml(nil) == nil)
|
||||
assert(EscapeHtml("?hello&there<>") == "?hello&there<>")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue