Skip to content

Instantly share code, notes, and snippets.

@jamescw
Created June 27, 2014 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamescw/6ae15d64459ddd2a451a to your computer and use it in GitHub Desktop.
Save jamescw/6ae15d64459ddd2a451a to your computer and use it in GitHub Desktop.
number = '07045656789'
def hash_to_digits(num, length=10):
return abs(hash(num)) % (10 ** length)
hash = hash_to_digits(number)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment