Commit 710b25d7 authored by Nils Goroll's avatar Nils Goroll

update auto-generated readme

parent 979d8865
Pipeline #427 skipped
...@@ -21,7 +21,29 @@ digests, checksums and hmacs for the VCL blob type ...@@ -21,7 +21,29 @@ digests, checksums and hmacs for the VCL blob type
SYNOPSIS SYNOPSIS
======== ========
import blobdigest [from "path"] ;
::
import blobdigest [from "path"] ;
new xdigest = digest(ENUM, BLOB, ENUM)
BOOL xdigest.update(BLOB)
BLOB xdigest.final()
BLOB hash(ENUM, BLOB)
new xhmac = hmac(ENUM, BLOB)
BLOB xhmac.hmac(BLOB)
BLOB hmacf(ENUM, BLOB, BLOB)
STRING version()
BLOB uint32blob(INT)
:: ::
...@@ -202,24 +224,19 @@ values: ...@@ -202,24 +224,19 @@ values:
* ``SHA3_384`` * ``SHA3_384``
* ``SHA3_512`` * ``SHA3_512``
CONTENTS
========
* digest(ENUM {CRC32,ICRC32,MD5,RS,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512}, BLOB, ENUM {TASK,TOP})
* BLOB hash(ENUM {CRC32,ICRC32,MD5,RS,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512}, BLOB)
* 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: .. _obj_digest:
digest new xdigest = digest(ENUM, BLOB, ENUM)
------ --------------------------------------
:: ::
new OBJ = digest(ENUM {CRC32,ICRC32,MD5,RS,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512} hash, BLOB init=0, ENUM {TASK,TOP} scope=TASK) new xdigest = digest(
ENUM {CRC32, ICRC32, MD5, RS, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224, SHA3_256, SHA3_384, SHA3_512} hash,
BLOB init=0,
ENUM {TASK, TOP} scope=TASK
)
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
...@@ -253,12 +270,8 @@ Example:: ...@@ -253,12 +270,8 @@ Example::
.. _func_digest.update: .. _func_digest.update:
digest.update BOOL xdigest.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.
Returns ``true`` if and only if the operation was successful. Returns ``true`` if and only if the operation was successful.
...@@ -311,14 +324,11 @@ Example:: ...@@ -311,14 +324,11 @@ Example::
call do_backend_error; call do_backend_error;
} }
.. _func_digest.final:
digest.final
------------
:: .. _func_digest.final:
BLOB digest.final() BLOB xdigest.final()
--------------------
Finalize the message digest and return the result. Finalize the message digest and return the result.
...@@ -399,14 +409,21 @@ Example:: ...@@ -399,14 +409,21 @@ Example::
# Baz-Hash-Base64: base64-encoded SHA3_256 hash of "baz" # Baz-Hash-Base64: base64-encoded SHA3_256 hash of "baz"
# Baz-Hash-Hex: hex-encoded SHA3_256 hash of "bar" # Baz-Hash-Hex: hex-encoded SHA3_256 hash of "bar"
.. _func_hash: .. _func_hash:
hash BLOB hash(ENUM, BLOB)
---- ---------------------
:: ::
BLOB hash(ENUM {CRC32,ICRC32,MD5,RS,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512} hash, BLOB msg) BLOB hash(
ENUM {CRC32, ICRC32, MD5, RS, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224, SHA3_256, SHA3_384, SHA3_512} hash,
BLOB msg
)
Returns the message digest for ``msg`` as specified by ``hash``. Returns the message digest for ``msg`` as specified by ``hash``.
...@@ -422,14 +439,18 @@ Example:: ...@@ -422,14 +439,18 @@ Example::
blobdigest.hash(SHA256, blobdigest.hash(SHA256,
blob.decode(decoding=BASE64, encoded="Zm9v")); blob.decode(decoding=BASE64, encoded="Zm9v"));
.. _obj_hmac: .. _obj_hmac:
hmac new xhmac = hmac(ENUM, BLOB)
---- ----------------------------
:: ::
new OBJ = hmac(ENUM {MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512} hash, BLOB key) new xhmac = hmac(
ENUM {MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224, SHA3_256, SHA3_384, SHA3_512} 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``.
...@@ -448,12 +469,8 @@ Example:: ...@@ -448,12 +469,8 @@ Example::
.. _func_hmac.hmac: .. _func_hmac.hmac:
hmac.hmac BLOB xhmac.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
provided in the constructor. provided in the constructor.
...@@ -472,14 +489,22 @@ Example:: ...@@ -472,14 +489,22 @@ Example::
return(synth(401)); return(synth(401));
} }
.. _func_hmacf: .. _func_hmacf:
hmacf BLOB hmacf(ENUM, BLOB, BLOB)
----- ----------------------------
:: ::
BLOB hmacf(ENUM {MD5,SHA1,SHA224,SHA256,SHA384,SHA512,SHA3_224,SHA3_256,SHA3_384,SHA3_512} hash, BLOB key, BLOB msg) BLOB hmacf(
ENUM {MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224, SHA3_256, SHA3_384, SHA3_512} hash,
BLOB key,
BLOB msg
)
Returns the HMAC for ``msg`` as specified by ``hash`` and the ``key``. Returns the HMAC for ``msg`` as specified by ``hash`` and the ``key``.
...@@ -507,14 +532,11 @@ Example:: ...@@ -507,14 +532,11 @@ Example::
blob.decode(encoded= blob.decode(encoded=
req.http.Msg))); req.http.Msg)));
.. _func_version:
version
-------
:: .. _func_version:
STRING version() STRING version()
----------------
Returns the version string for this VMOD. Returns the version string for this VMOD.
...@@ -522,14 +544,11 @@ Example:: ...@@ -522,14 +544,11 @@ Example::
std.log("Using VMOD blobdigest version " + blobdigest.version()); std.log("Using VMOD blobdigest version " + blobdigest.version());
.. _func__uint32blob:
_uint32blob .. _func_uint32blob:
-----------
:: BLOB uint32blob(INT)
--------------------
BLOB _uint32blob(INT)
Intentionally undocumented, transitional helper only Intentionally undocumented, transitional helper only
...@@ -588,6 +607,7 @@ SEE ALSO ...@@ -588,6 +607,7 @@ SEE ALSO
* https://github.com/rhash/RHash * https://github.com/rhash/RHash
* http://rhash.anz.ru/ * http://rhash.anz.ru/
COPYRIGHT COPYRIGHT
========= =========
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment