diff options
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 37 |
1 files changed, 29 insertions, 8 deletions
@@ -52306,9 +52306,10 @@ which constitute its UTF-8 representation. The CRC-32 is returned as a non-negative integer. -.coNP Function @ sha256-stream +.coNP Functions @ sha256-stream and @ md5-stream .synb .mets (sha256-stream < stream >> [ nbytes <> [ buf ]]) +.mets (md5-stream < stream >> [ nbytes <> [ buf ]]) .syne .desc The @@ -52317,6 +52318,11 @@ calculates the NIST SHA-256 digest over the bytes read from .metn stream , starting at the stream's current position. +The +.code md5-stream +function calculates the MD5 digest, using the +RSA Data Security, Inc. MD5 Message-Digest Algorithm. + If the .meta nbytes argument is specified, it should be a nonnegative @@ -52326,15 +52332,20 @@ until the end of the stream. If the .meta buf -argument is omitted, the 256 bit digest value is returned as a new, -32-byte-long buffer object. If the +argument is omitted, the digest value is returned as a new, +buffer object. This buffer is 32 bytes long in the case of SHA-256, +holding a 256-bit digest, and 16 bytes long in the case of MD5, +holding a 128-bit digest. +If the .meta buf -argument is specified, it must be a buffer that is at least 32 bytes long. +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 Function @ sha256 +.coNP Functions @ sha256 and @ md5 .synb .mets (sha256 < obj <> [ buf ]) +.mets (md5 < obj <> [ buf ]) .syne .desc The @@ -52343,6 +52354,12 @@ function calculates the NIST SHA-256 digest over .metn obj , which may be a character string or a buffer. +Similarly, the +.code md5 +functions calculates the MD5 digest over +.metn obj , +using the RSA Data Security, Inc. MD5 Message-Digest Algorithm. + If .meta obj is a buffer, then the digest is calculated over all of the bytes contained @@ -52355,10 +52372,14 @@ which constitute its UTF-8 representation. If the .meta buf -argument is omitted, the 256 bit digest value is returned as a new, -32-byte-long buffer object. If the +argument is omitted, the digest value is returned as a new, +buffer object. This buffer is 32 bytes long in the case of SHA-256, +holding a 256-bit digest, and 16 bytes long in the case of MD5, +holding a 128-bit digest. +If the .meta buf -argument is specified, it must be a buffer that is at least 32 bytes long. +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. .SS* The Awk Utility |