MCPcopy Create free account
hub / github.com/ActiveState/code / __newsid

Method __newsid

recipes/Python/577524_Python_Sessions/recipe-577524.py:68–72  ·  view source on GitHub ↗

Create a new session ID

()

Source from the content-addressed store, hash-verified

66
67 @staticmethod
68 def __newsid():
69 """Create a new session ID"""
70 h = hashlib.new("ripemd160")
71 h.update(str(time.time()/time.clock()**-1)+str(os.getpid()))
72 return h.hexdigest()
73
74 def __getsid(self):
75 """Get the current session ID or return a new one"""

Callers 1

__getsidMethod · 0.95

Calls 5

strFunction · 0.85
hexdigestMethod · 0.80
newMethod · 0.45
updateMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected