diff options
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 112 |
1 files changed, 112 insertions, 0 deletions
@@ -52382,6 +52382,118 @@ argument is specified, it must be a buffer that is at least 16 bytes long in the case of MD5, and at least 32 bytes long in the case of SHA-256. The hash is placed into that buffer, which is then returned. +.coNP Functions @, sha256-begin @ sha256-hash and @ sha256-end +.synb +.mets (sha256-begin) +.mets (sha256-hash < ctx << obj ) +.mets (sha256-end < ctx <> [ buf ]) +.syne +.desc +The three functions +.codn sha256-begin , +.code sha256-hash +and +.code sha256-end +implement a stateful computation of SHA256 digest which allows multiple input +sources to contribute to the result. Furthermore, the context object may be +serially re-used for calculating multiple digests. + +The +.code sha256-begin +function, which takes no arguments, returns a new SHA256 digest-producing +context object. + +The +.code sha256-hash +updates the state of the SHA256 digest object +.meta ctx +by including +.meta obj +into the digest calculation. The +.meta obj +argument may be a character string, whose UTF-8 representation is digested, +or a buffer object, whose contents are digested. +The +.code sha256-hash +function may be called multiple times to include any mixture of +strings and buffers into the digest calculation. + +The +.code sha256-end +function finalizes the digest calculation and returns the digest in +a buffer. If the +.meta buf +argument is omitted, then a new 32-byte buffer is created for this +purpose. Otherwise, +.meta buf +must specify a +.code buf +object that is at least 32 bytes long. The digest is stored into this +buffer and that the buffer is returned. + +The +.code sha256-end +function additionally resets the +.meta ctx +object into the initial state of a newly created context object, so +that it may be used for another digest session. + +.coNP Functions @, md5-begin @ md5-hash and @ md5-end +.synb +.mets (md5-begin) +.mets (md5-hash < ctx << obj ) +.mets (md5-end < ctx <> [ buf ]) +.syne +.desc +The three functions +.codn md5-begin , +.code md5-hash +and +.code md5-end +implement a stateful computation of MD5 digest which allows multiple input +sources to contribute to the result. Furthermore, the context object may be +serially re-used for calculating multiple digests. + +The +.code md5-begin +function, which takes no arguments, returns a new MD5 digest-producing +context object. + +The +.code md5-hash +updates the state of the MD5 digest object +.meta ctx +by including +.meta obj +into the digest calculation. The +.meta obj +argument may be a character string, whose UTF-8 representation is digested, +or a buffer object, whose contents are digested. +The +.code md5-hash +function may be called multiple times to include any mixture of +strings and buffers into the digest calculation. + +The +.code md5-end +function finalizes the digest calculation and returns the digest in +a buffer. If the +.meta buf +argument is omitted, then a new 16-byte buffer is created for this +purpose. Otherwise, +.meta buf +must specify a +.code buf +object that is at least 16 bytes long. The digest is stored into this +buffer and that the buffer is returned. + +The +.code md5-end +function additionally resets the +.meta ctx +object into the initial state of a newly created context object, so +that it may be used for another digest session. + .SS* The Awk Utility The \*(TL library provides a macro called |