rename digest.R, expand documentation and add checks/params