Created
November 12, 2012 10:23
-
-
Save markmeriales/4058523 to your computer and use it in GitHub Desktop.
get_random_hex_by_length
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def get_random_hex_by_length(length=4): | |
"""Returns a random hex code according to length""" | |
return hex(random.randint((16**((length)-1)),(16**length)))[2:] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Returns a random hex code according to length