hex id hash creation and validation module for phant