create a functional-style digest checker (functional java makes my head hurt)