Check hash validity