I\'m trying to write some code to work with an htdigest password file. The documentation I can find seems to claim that the format of that file is:
user:real
echo by default adds a trailing new line:
echo
echo -n a:b:c | md5
Should work as you expect.