Move hash util functions to HashUtils