[PATCH v8 1/3] lib: introduce HASH_CALCULATE option