added hex validation

Tests are missing for this code