lib: introduce HASH_CALCULATE option