Class DMD5

Inherits from:
Object
Declared in:
DMD5.h

Class Hierarchy

    Object
      |
      +---DMD5

Class Description

The DMD5 class implements a number of methods for using the RSA's MD5 message algorithmes.

Example:
#include <stdio.h>
#include "ofc/DMD5.h"

int main(int argc, char *argv[])
{
  DMD5  *md1  = [DMD5 alloc];
  DMD5  *md2  = [DMD5 new  ];
  DText *str;
  DData *data;

  [md1 init :"This is a test string for MD5"]; // Init with a c-string

  str = [md1 hexdigest];               // Convert MD5 value of string to hex
  printf("MD5 digest in hex of \"This is a test string for MD5\":%s.\n", [str cstring]);
  [str free];

  [md2 update :"abcdefghijklmnopqrstuvwxyz"]; // Update the md2 with a c-string and ..
  [md2 update :"0123456789" :10];      // .. data string

  data = [md2 digest];                 // Convert MD5 result to data string
  str  = [data toBase64];              // Convert data string to base64
  printf("MD5 (in base64) of \"abcdefghijklmnopqrstuvwxyz0123456789\":%s.\n", [str cstring]);
  [str  free];
  [data free];

  [md1 free];                          // Cleanup
  [md2 free];

  return 0;
}
Last modified:
02-Aug-2008 (DMD5.h)

Instance Variables

private MD5_CTX _md5
the md5 context

Method Index


generated 06-Sep-2008 by ObjcDoc 3.0.0