Moved length test after insecure hash algorithms, as they will nevern produce a hash bigger than 56 in length.