Skip to content

Commit

Permalink
using Version 1 uuid as specified by RFC4122
Browse files Browse the repository at this point in the history
  • Loading branch information
skariel committed Jan 31, 2014
1 parent 7fbe65c commit 8e17fdd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions webalchemy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from types import ModuleType
from collections import OrderedDict

from uuid import uuid1

import tornado
import tornado.web
import tornado.ioloop
Expand All @@ -44,10 +46,9 @@


def _generate_session_id():
"""Generate a random session id.
The id is not guaranteed to be unique."""
#TODO: Guarantee unique ids
return str(random.randint(0, 1e16))
"""Generate a session id.
a Version 1 uuid as specified by RFC4122, see here: http://tools.ietf.org/html/rfc4122.html"""
return str(uuid1())

@gen.coroutine
def async_delay(secs):
Expand Down

0 comments on commit 8e17fdd

Please sign in to comment.