ftp.nice.ch/pub/next/unix/mail/fetchmail.4.3.7.s.tar.gz#/fetchmail-4.3.7/md5ify.c

This is md5ify.c in view mode; [Download] [Up]

/*
 * For license terms, see the file COPYING in this directory.
 */

/***********************************************************************
  module:       md5ify.c
  project:      fetchmail
  programmer:   Carl Harris, ceharris@mal.com
  description:  Simple interface to MD5 module.

 ***********************************************************************/

#include <stdio.h>

#if defined(STDC_HEADERS)
#include <string.h>
#endif

#include "md5.h"

char *
MD5Digest (s)
unsigned char *s;
{
  int i;
  MD5_CTX context;
  unsigned char digest[16];
  static char ascii_digest [33];

  MD5Init(&context);
  MD5Update(&context, s, strlen(s));
  MD5Final(digest, &context);
  
  for (i = 0;  i < 16;  i++) 
    sprintf(ascii_digest+2*i, "%02x", digest[i]);
 
  return(ascii_digest);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.