Skip to content

Commit a3b0164

Browse files
committed
Fix the example in readme.
1 parent d2ed14e commit a3b0164

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

hex/README.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,7 @@ local hex = require("hex")
1111

1212
s = hex:encode_to_string("foo\01bar")
1313
print(s)
14-
Zm9vAWJhcg
15-
16-
s = hex:encode_to_string("foo\01bar")
17-
print(s)
18-
Zm9vAWJhcg==
19-
20-
s = hex:encode_to_string("this is a <tag> and should be encoded")
21-
print(s)
22-
dGhpcyBpcyBhIDx0YWc-IGFuZCBzaG91bGQgYmUgZW5jb2RlZA
23-
24-
s = hex:encode_to_string("this is a <tag> and should be encoded")
25-
print(s)
26-
dGhpcyBpcyBhIDx0YWc-IGFuZCBzaG91bGQgYmUgZW5jb2RlZA==
14+
666f6f01626172
2715

2816
```
2917

@@ -32,12 +20,12 @@ dGhpcyBpcyBhIDx0YWc-IGFuZCBzaG91bGQgYmUgZW5jb2RlZA==
3220
```lua
3321
local hex = require 'hex'
3422

35-
decoded, err = hex.decode_string("666f6f62617262617a")
23+
decoded, err = hex.decode_string("666f6f01626172")
3624
assert(not err, err)
3725
print(decoded)
3826
foobar
3927

4028
encoded = hex.encode_to_string(decoded)
4129
print(encoded)
42-
666f6f62617262617a
30+
666f6f01626172
4331
```

0 commit comments

Comments
 (0)