`pre_stored || !digest` should be `pre_stored && !digest`.