lib/core: Added validation method for hexdigest