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
2036307d
Commit
2036307d
authored
Nov 07, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix docs to accomadate automatic generation by the Varnish 5.0 vmodtool
parent
4c7d69b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
54 deletions
+48
-54
README.rst
README.rst
+44
-36
vmod_blobdigest.vcc
src/vmod_blobdigest.vcc
+4
-18
No files found.
README.rst
View file @
2036307d
...
@@ -12,9 +12,9 @@
...
@@ -12,9 +12,9 @@
vmod_blobdigest
vmod_blobdigest
===============
===============
--------------------------------------------------
-
--------------------------------------------------
digests
, checksums and hmacs for the VCL blob type
digests, checksums and hmacs for the VCL blob type
--------------------------------------------------
-
--------------------------------------------------
:Manual section: 3
:Manual section: 3
...
@@ -203,22 +203,19 @@ values:
...
@@ -203,22 +203,19 @@ values:
CONTENTS
CONTENTS
========
========
* Object digest
* digest(ENUM {CRC32,MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512}, BLOB)
* BLOB digest.final()
* BLOB hash(ENUM {CRC32,MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512}, BLOB)
* BOOL digest.update(BLOB)
* hmac(ENUM {MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512}, BLOB)
* BLOB hash(ENUM, BLOB)
* Object hmac
* BLOB hmac.hmac(BLOB)
* STRING version()
* STRING version()
.. _obj_digest:
.. _obj_digest:
Object
digest
digest
=============
------
::
Prototype
new OBJ = digest(ENUM {CRC32,MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512} hash, BLOB init=0)
new OBJ = blobdigest.digest(ENUM hash[, BLOB init])
Initialize a message digest context for the algorithm ``hash``, and
Initialize a message digest context for the algorithm ``hash``, and
optionally update it with ``init``. If ``init`` is left out, then an
optionally update it with ``init``. If ``init`` is left out, then an
...
@@ -245,10 +242,11 @@ Example::
...
@@ -245,10 +242,11 @@ Example::
.. _func_digest.update:
.. _func_digest.update:
BOOL digest.update(BLOB)
digest.update
------------------------
-------------
::
Prototype
BOOL digest.update(BLOB)
BOOL digest.update(BLOB)
Incrementally add the BLOB to the digest context of this object.
Incrementally add the BLOB to the digest context of this object.
...
@@ -304,10 +302,11 @@ Example::
...
@@ -304,10 +302,11 @@ Example::
.. _func_digest.final:
.. _func_digest.final:
BLOB digest.final()
digest.final
-------------------
------------
::
Prototype
BLOB digest.final()
BLOB digest.final()
Finalize the message digest and return the result.
Finalize the message digest and return the result.
...
@@ -392,11 +391,12 @@ Example::
...
@@ -392,11 +391,12 @@ Example::
.. _func_hash:
.. _func_hash:
BLOB hash(ENUM, BLOB)
hash
---------------------
----
::
Prototype
BLOB hash(ENUM {CRC32,MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512} hash, BLOB msg)
BLOB hash(ENUM hash, BLOB msg)
Returns the message digest for ``msg`` as specified by ``hash``.
Returns the message digest for ``msg`` as specified by ``hash``.
...
@@ -414,12 +414,12 @@ Example::
...
@@ -414,12 +414,12 @@ Example::
.. _obj_hmac:
.. _obj_hmac:
Object
hmac
hmac
===========
----
::
Prototype
new OBJ = hmac(ENUM {MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512} hash, BLOB key)
new OBJ = blobdigest.hmac(ENUM hash, BLOB key)
Creates an object that generates HMACs based on the digest algorithm
Creates an object that generates HMACs based on the digest algorithm
``hash`` and the given ``key``.
``hash`` and the given ``key``.
...
@@ -438,10 +438,11 @@ Example::
...
@@ -438,10 +438,11 @@ Example::
.. _func_hmac.hmac:
.. _func_hmac.hmac:
BLOB hmac.hmac(BLOB)
hmac.hmac
--------------------
---------
::
Prototype
BLOB hmac.hmac(BLOB msg)
BLOB hmac.hmac(BLOB msg)
Returns the HMAC for ``msg`` based on the key and hash algorithm
Returns the HMAC for ``msg`` based on the key and hash algorithm
...
@@ -463,10 +464,11 @@ Example::
...
@@ -463,10 +464,11 @@ Example::
.. _func_version:
.. _func_version:
STRING version()
version
----------------
-------
::
Prototype
STRING version()
STRING version()
Returns the version string for this VMOD.
Returns the version string for this VMOD.
...
@@ -536,7 +538,13 @@ SEE ALSO
...
@@ -536,7 +538,13 @@ SEE ALSO
COPYRIGHT
COPYRIGHT
=========
=========
This document is licensed under the same conditions as the
::
libvmod-blobcode project. See `LICENSE <LICENSE>`_ for details.
Copyright (c) 2016 UPLEX Nils Goroll Systemoptimierung
All rights reserved
Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
See LICENSE
* Copyright (c) 2016 UPLEX Nils Goroll Systemoptimierung
src/vmod_blobdigest.vcc
View file @
2036307d
...
@@ -83,7 +83,7 @@ Here are some examples::
...
@@ -83,7 +83,7 @@ Here are some examples::
import blobdigest;
import blobdigest;
import blobcode;
import blobcode;
import blob;
import blob;
sub vcl_init {
sub vcl_init {
# Create a BLOB consisting of the string "foo"
# Create a BLOB consisting of the string "foo"
new foo = blobcode.blob(IDENTITY, "foo");
new foo = blobcode.blob(IDENTITY, "foo");
...
@@ -138,7 +138,7 @@ and returns the result. It is functionally equivalent to using a
...
@@ -138,7 +138,7 @@ and returns the result. It is functionally equivalent to using a
import blobdigest;
import blobdigest;
import blobcode;
import blobcode;
sub vcl_init {
sub vcl_init {
# Create a SHA256 context
# Create a SHA256 context
new sha256 = blobdigest.digest(SHA256);
new sha256 = blobdigest.digest(SHA256);
...
@@ -188,9 +188,6 @@ values:
...
@@ -188,9 +188,6 @@ values:
$Object digest(ENUM {CRC32, MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224,
$Object digest(ENUM {CRC32, MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224,
SHA3_256, SHA3_384, SHA3_512} hash, BLOB init=0)
SHA3_256, SHA3_384, SHA3_512} hash, BLOB init=0)
Prototype
new OBJ = blobdigest.digest(ENUM hash[, BLOB init])
Initialize a message digest context for the algorithm ``hash``, and
Initialize a message digest context for the algorithm ``hash``, and
optionally update it with ``init``. If ``init`` is left out, then an
optionally update it with ``init``. If ``init`` is left out, then an
empty initial context is created.
empty initial context is created.
...
@@ -207,7 +204,7 @@ Example::
...
@@ -207,7 +204,7 @@ Example::
sub vcl_init {
sub vcl_init {
# Create an empty digest context for SHA3_256
# Create an empty digest context for SHA3_256
new sha3_256 = blobdigest.digest(SHA3_256);
new sha3_256 = blobdigest.digest(SHA3_256);
# Create a digest context for SHA512, and add "foo"
# Create a digest context for SHA512, and add "foo"
# as a "prefix" for all other messages to be hashed.
# as a "prefix" for all other messages to be hashed.
new foo = blobcode.blob(IDENTITY, "foo")
new foo = blobcode.blob(IDENTITY, "foo")
...
@@ -305,7 +302,7 @@ Example::
...
@@ -305,7 +302,7 @@ Example::
# Retrieve the hash for "foo" computed in vcl_init
# Retrieve the hash for "foo" computed in vcl_init
set req.http.Foo-Hash
set req.http.Foo-Hash
= blobcode.encode(BASE64, foohash.final());
= blobcode.encode(BASE64, foohash.final());
# Compute the base64-encoded SHA3_256 hash for "bar"
# Compute the base64-encoded SHA3_256 hash for "bar"
if (!sha3_256.update(blobcode.decode(IDENTITY, "bar"))) {
if (!sha3_256.update(blobcode.decode(IDENTITY, "bar"))) {
call do_client_error;
call do_client_error;
...
@@ -370,9 +367,6 @@ Example::
...
@@ -370,9 +367,6 @@ Example::
$Object hmac(ENUM {MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224,
$Object hmac(ENUM {MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224,
SHA3_256, SHA3_384, SHA3_512} hash, BLOB key)
SHA3_256, SHA3_384, SHA3_512} hash, BLOB key)
Prototype
new OBJ = blobdigest.hmac(ENUM hash, BLOB key)
Creates an object that generates HMACs based on the digest algorithm
Creates an object that generates HMACs based on the digest algorithm
``hash`` and the given ``key``.
``hash`` and the given ``key``.
...
@@ -472,11 +466,3 @@ SEE ALSO
...
@@ -472,11 +466,3 @@ SEE ALSO
* https://github.com/rhash/RHash
* https://github.com/rhash/RHash
* http://rhash.anz.ru/
* http://rhash.anz.ru/
COPYRIGHT
=========
This document is licensed under the same conditions as the
libvmod-blobcode project. See `LICENSE <LICENSE>`_ for details.
* Copyright (c) 2016 UPLEX Nils Goroll Systemoptimierung
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