To encourage the culture of avoiding dissemination of confidential data across multiple copies of "the same object" in runtime memory:
instead of:
string password = copyPasswordFromAnotherString(inputArg);
string salt = generateRandomSalt();
string tohash = password+salt;
return(hash.digest());
prefer:
hash.update(inputArg);
string salt = generateRandomSalt();
hash.update(salt);
return(hash.digest());
Also (as probably meant by poncho), to help use cases involving hashes built from data obtained incrementally (i.e.: hashing a large confidential document without having copies of it in runtime memory)
update()
based API I can easily hash a multi gigabyte file on a modest computer. $\endgroup$