Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-blobdigest
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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-blobdigest
Commits
392bb2ea
Commit
392bb2ea
authored
Dec 10, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add helper to get blob from a uint32 case of a VCL_INT
parent
7fe8ce98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
README.rst
README.rst
+12
-0
vmod_blobdigest.c
src/vmod_blobdigest.c
+22
-0
vmod_blobdigest.vcc
src/vmod_blobdigest.vcc
+4
-0
No files found.
README.rst
View file @
392bb2ea
...
...
@@ -207,6 +207,7 @@ CONTENTS
* hmac(ENUM {MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512}, BLOB)
* BLOB hmacf(ENUM {MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512}, BLOB, BLOB)
* STRING version()
* BLOB _uint32blob(INT)
.. _obj_digest:
...
...
@@ -518,6 +519,17 @@ Example::
std.log("Using VMOD blobdigest version " + blobdigest.version());
.. _func__uint32blob:
_uint32blob
-----------
::
BLOB _uint32blob(INT)
Intentionally undocumented, transitional helper only
REQUIREMENTS
============
...
...
src/vmod_blobdigest.c
View file @
392bb2ea
...
...
@@ -590,3 +590,25 @@ vmod_version(VRT_CTX __attribute__((unused)))
{
return
VERSION
;
}
/* vend.h is varinshd private */
static
__inline
void
vbe32enc
(
void
*
pp
,
uint32_t
u
)
{
uint8_t
*
p
=
(
uint8_t
*
)
pp
;
p
[
0
]
=
(
u
>>
24
)
&
0xff
;
p
[
1
]
=
(
u
>>
16
)
&
0xff
;
p
[
2
]
=
(
u
>>
8
)
&
0xff
;
p
[
3
]
=
u
&
0xff
;
}
VCL_BLOB
vmod__uint32blob
(
VRT_CTX
,
VCL_INT
i
)
{
uint32_t
ui
=
(
uint32_t
)
i
;
uint8_t
be
[
sizeof
ui
];
vbe32enc
(
be
,
ui
);
return
(
VRT_blob
(
ctx
,
"uint32blob"
,
be
,
sizeof
be
));
}
src/vmod_blobdigest.vcc
View file @
392bb2ea
...
...
@@ -445,6 +445,10 @@ Example::
std.log("Using VMOD blobdigest version " + blobdigest.version());
$Function BLOB _uint32blob(INT)
Intentionally undocumented, transitional helper only
REQUIREMENTS
============
...
...
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