![]() |
![]()
| ![]() |
![]()
NAMEzdigest - Class for provides hashing functions (SHA-1 at present) SYNOPSIS// This is a stable class, and may not change except for emergencies. It // is provided in stable builds. // Constructor - creates new digest object, which you use to build up a // digest by repeatedly calling zdigest_update() on chunks of data. CZMQ_EXPORT zdigest_t * DESCRIPTIONThe zdigest class generates a hash from zchunks of data. The current algorithm is SHA-1, chosen for speed. We are aiming to generate a unique digest for a file, and there are no security issues in this use case. The current code depends on OpenSSL, which might be replaced by hard coded SHA-1 implementation to reduce build dependencies. EXAMPLEFrom zdigest_test method. byte *buffer = (byte *) zmalloc (1024); memset (buffer, 0xAA, 1024); zdigest_t *digest = zdigest_new (); assert (digest); zdigest_update (digest, buffer, 1024); const byte *data = zdigest_data (digest); assert (data [0] == 0xDE); assert (data [1] == 0xB2); assert (data [2] == 0x38); assert (data [3] == 0x07); assert (streq (zdigest_string (digest), AUTHORSThe czmq manual was written by the authors in the AUTHORS file. RESOURCESMain web site: Report bugs to the email <zeromq-dev@lists.zeromq.org[1]> COPYRIGHTCopyright (c) the Contributors as noted in the AUTHORS file. This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. LICENSE included with the czmq distribution. NOTES
mailto:zeromq-dev@lists.zeromq.org
|