added digest functions