Skip to content

Commit c509669

Browse files
committed
Update README.
1 parent 24bd69b commit c509669

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

hex/README.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,12 @@ dGhpcyBpcyBhIDx0YWc-IGFuZCBzaG91bGQgYmUgZW5jb2RlZA==
3232
```lua
3333
local hex = require 'hex'
3434

35-
s, err = hex.decode_string("Zm9vAWJhcg")
35+
decoded, err = hex.decode_string("666f6f62617262617a")
3636
assert(not err, err)
37-
print(s)
38-
foobar
39-
40-
s, err = hex.StdEncoding:decode_string("Zm9vAWJhcg==")
41-
assert(not err, err)
42-
print(s)
37+
print(decoded)
4338
foobar
4439

45-
s, err = hex.RawURLEncoding:decode_string("dGhpcyBpcyBhIDx0YWc-IGFuZCBzaG91bGQgYmUgZW5jb2RlZA")
46-
assert(not err, err)
47-
print(s)
48-
this is a <tag> and should be encoded
49-
50-
s, err = hex.URLEncoding:decode_string("dGhpcyBpcyBhIDx0YWc-IGFuZCBzaG91bGQgYmUgZW5jb2RlZA==")
51-
assert(not err, err)
52-
print(s)
53-
this is a <tag> and should be encoded
40+
encoded = hex.encode_to_string(decoded)
41+
print(encoded)
42+
666f6f62617262617a
5443
```

0 commit comments

Comments
 (0)