FreeBSD/sbin/md5/md5.c
/*
 * Digests the standard input and prints the result.
 */
Digests the standard input and prints the result.
Digests the standard input and prints the result .
static void
MDFilter(const Algorithm_t *alg, int tee)
{
	DIGEST_CTX context;
	unsigned int len;
	unsigned char buffer[BUFSIZ];
	char buf[HEX_DIGEST_LENGTH];
	alg->Init(&context);
	while ((len = fread(buffer, 1, BUFSIZ, stdin))) {
		if (tee && len != fwrite(buffer, 1, len, stdout))
			err(1, "stdout");
		alg->Update(&context, buffer, len);
	}
	printf("%s\n", alg->End(&context, buf));
}
static void MDFilter ( const Algorithm_t * alg , int tee ) { DIGEST_CTX context ; unsigned int len ; unsigned char buffer [ BUFSIZ ] ; char buf [ HEX_DIGEST_LENGTH ] ; alg -> Init ( & context ) ; while ( ( len = fread ( buffer , 1 , BUFSIZ , stdin ) ) ) { if ( tee && len != fwrite ( buffer , 1 , len , stdout ) ) err ( 1 , " " ) ; alg -> Update ( & context , buffer , len ) ; } printf ( " \n " , alg -> End ( & context , buf ) ) ; }
Digests the standard input and prints the result.
Digests the standard input and prints the result .