FreeBSD/sbin/md5/md5.c
/*
 * Digests a string and prints the result.
 */
Digests a string and prints the result.
Digests a string and prints the result .
static void
MDString(const Algorithm_t *alg, const char *string)
{
	size_t len = strlen(string);
	char buf[HEX_DIGEST_LENGTH];
	alg->Data(string,len,buf);
	if (qflag)
		printf("%s", buf);
	else if (rflag)
		printf("%s \"%s\"", buf, string);
	else
		printf("%s (\"%s\") = %s", alg->name, string, buf);
	if (checkAgainst && strcmp(buf,checkAgainst))
	{
		checksFailed++;
		if (!qflag)
			printf(" [ failed ]");
	}
	printf("\n");
}
static void MDString ( const Algorithm_t * alg , const char * string ) { size_t len = strlen ( string ) ; char buf [ HEX_DIGEST_LENGTH ] ; alg -> Data ( string , len , buf ) ; if ( qflag ) printf ( " " , buf ) ; else if ( rflag ) printf ( " \" \" " , buf , string ) ; else printf ( " \" \" " , alg -> name , string , buf ) ; if ( checkAgainst && strcmp ( buf , checkAgainst ) ) { checksFailed ++ ; if ( ! qflag ) printf ( " " ) ; } printf ( " \n " ) ; }
Digests a string and prints the result.
Digests a string and prints the result .