Implemented digest functions.