Skip to content

Instantly share code, notes, and snippets.

/valid_hex.rb Secret

Created August 24, 2015 19:54
Show Gist options
  • Save anonymous/f6a38245a82342b5f25c to your computer and use it in GitHub Desktop.
Save anonymous/f6a38245a82342b5f25c to your computer and use it in GitHub Desktop.
def valid_hex?(hex)
hex.length == 7 &&
!hex.slice(1)[/\H/]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment