implemented digest end to end