digest before extension and not after