GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ZDIGEST (3)

.ds Aq ’

NAME

zdigest - provides hashing functions (SHA-1 at present)

CONTENTS

SYNOPSIS

//  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 *
    zdigest_new (void);

// Destroy a digest object CZMQ_EXPORT void zdigest_destroy (zdigest_t **self_p);

// Add buffer into digest calculation CZMQ_EXPORT void zdigest_update (zdigest_t *self, byte *buffer, size_t length);

// Return final digest hash data. If built without crypto support, returns // NULL. CZMQ_EXPORT byte * zdigest_data (zdigest_t *self);

// Return final digest hash size CZMQ_EXPORT size_t zdigest_size (zdigest_t *self);

// Return digest as printable hex string; caller should not modify nor // free this string. After calling this, you may not use zdigest_update() // on the same digest. If built without crypto support, returns NULL. CZMQ_EXPORT char * zdigest_string (zdigest_t *self);

// Self test of this class CZMQ_EXPORT void zdigest_test (bool verbose);

DESCRIPTION

The 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.

EXAMPLE

From zdigest_test method.

byte *buffer = (byte *) zmalloc (1024);
memset (buffer, 0xAA, 1024);

zdigest_t *digest = zdigest_new (); assert (digest); zdigest_update (digest, buffer, 1024); 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), "DEB23807D4FE025E900FE9A9C7D8410C3DDE9671")); zdigest_destroy (&digest); free (buffer);

AUTHORS

The czmq manual was written by the authors in the AUTHORS file.

RESOURCES

Main web site: \m[blue] \m[]

Report bugs to the email <\m[blue]zeromq-dev@lists.zeromq.org\m[][1]>

COPYRIGHT

Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com Copyright other 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

1. zeromq-dev@lists.zeromq.org  mailto:zeromq-dev@lists.zeromq.org
Search for    or go to Top of page |  Section 3 |  Main Index


CZMQ 3&.0&.1 ZDIGEST (3) 06/01/2015

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.