Skip to content

Instantly share code, notes, and snippets.

@jeffbryner
Created June 3, 2014 21:46
Show Gist options
  • Save jeffbryner/773c31132f6b01645445 to your computer and use it in GitHub Desktop.
Save jeffbryner/773c31132f6b01645445 to your computer and use it in GitHub Desktop.
generate a meteor-style object ID from python for use in mongoDB
def genMeteorID():
return('%024x' % random.randrange(16**24))
@ramnes
Copy link

ramnes commented Aug 12, 2022

See here for an implementation that's closer to Meteor's one and handles different sizes.

I'm shamelessly hi-jacking because this is the first result on Google for "meteor id python". ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment