allow to compute hash at compile time, fix issue 1926, partial fix issues 5279 and 6238