Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-blobcode
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-blobcode
Commits
a2326dfb
Commit
a2326dfb
authored
Jan 22, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix hex decode for lower-case hex digits
parent
b47ed0a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
hex.c
src/hex.c
+3
-3
hex.vtc
src/tests/hex.vtc
+7
-2
No files found.
src/hex.c
View file @
a2326dfb
...
...
@@ -43,15 +43,15 @@ static const char hex_alphabet[][16] = {
/*
* Shift the ASCII table over so that it begins at '0', and replace the
* hex digits with their binary values. This fits all of the hex digits
* into 5
4
bytes (cacheline friendly).
* into 5
5
bytes (cacheline friendly).
*/
static
const
uint8_t
nibble
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
10
,
11
,
12
,
13
,
14
,
15
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
10
,
11
,
12
,
13
,
14
,
15
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
10
,
1
1
,
1
2
,
13
,
14
,
15
};
static
inline
int
...
...
src/tests/hex.vtc
View file @
a2326dfb
...
...
@@ -20,10 +20,14 @@ varnish v1 -vcl+backend {
convert
.
encode
(
HEX
,
convert
.
decode
(
IDENTITY
,
"The quick brown fox jumps over the lazy dog"
));
set
resp
.
http
.
dec
=
set
resp
.
http
.
dec
uc
=
convert
.
encode
(
IDENTITY
,
convert
.
decode
(
HEX
,
"666F6F206261722062617A2071757578"
));
set
resp
.
http
.
declc
=
convert
.
encode
(
IDENTITY
,
convert
.
decode
(
HEX
,
"666f6f206261722062617a2071757578"
));
set
resp
.
http
.
decempty
=
convert
.
encode
(
IDENTITY
,
convert
.
decode
(
HEX
,
""
));
...
...
@@ -67,7 +71,8 @@ client c1 {
rxresp
expect
resp
.
http
.
hexlc
==
"54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f67"
expect
resp
.
http
.
hexuc
==
"54686520717569636B2062726F776E20666F78206A756D7073206F76657220746865206C617A7920646F67"
expect
resp
.
http
.
dec
==
"foo bar baz quux"
expect
resp
.
http
.
decuc
==
"foo bar baz quux"
expect
resp
.
http
.
declc
==
"foo bar baz quux"
expect
resp
.
http
.
decempty
==
""
expect
resp
.
http
.
decempty2bytes
==
""
expect
resp
.
http
.
decempty1byte
==
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment