Skip to content

Instantly share code, notes, and snippets.

@marklit
Last active August 22, 2017 20:10
Show Gist options
  • Select an option

  • Save marklit/b3f362bc382a448cae73 to your computer and use it in GitHub Desktop.

Select an option

Save marklit/b3f362bc382a448cae73 to your computer and use it in GitHub Desktop.
UUIDs that fit in the AWS Redshift BIGINT field type
import hashlib
import uuid
int(hashlib.sha1(str(uuid.uuid4()).replace('-', '')).hexdigest(), 16) % 2147483647
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment