Skip to content

Commit

Permalink
Update README with better examples
Browse files Browse the repository at this point in the history
Spotted by: Magnus Hagander.
  • Loading branch information
KristianLyng committed Dec 14, 2011
1 parent c161341 commit 6fa5034
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.rst
Expand Up @@ -95,13 +95,13 @@ Prototype
digest.hmac_sha1(<key>, <message>);
digest.hmac_sha256(<key>, <message));
Returns
String
String. Hex-encoded prepended with 0x.
Description
All the various hmac-functions work the same, but use a different
hash mechanism.
Example
::

set resp.http.x-data-sig =
digest.hmac_sha256("secretkey",resp.http.x-data);

Expand All @@ -126,7 +126,8 @@ Example
::

set resp.http.x-data-sig =
digest.base64(digest.hmac_sha256("secret",resp.http.x-data));
digest.base64({"content with
newline in it"});

hash_(algorithm)
----------------
Expand Down Expand Up @@ -190,12 +191,7 @@ Description
and practicality.
Example
::

if (digest.base64_decode(
digest.hmac_sha256("secret",req.http.x-data)
) == req.http.x-data-sig) {
...
}
synthetic(digest.base64_decode(req.http.x-parrot));

version
-------
Expand Down Expand Up @@ -244,6 +240,8 @@ This Vmod was written for Media Norge, Schibsted and others.

The bulk of the functionality is acquired through libmhash

Bug reports by: Magnus Hagander

HISTORY
=======

Expand Down

0 comments on commit 6fa5034

Please sign in to comment.