Skip to content

Commit

Permalink
system random
Browse files Browse the repository at this point in the history
  • Loading branch information
gcmalloc committed Jan 16, 2014
1 parent b944341 commit 806cf61
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/configs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import uuid
import datetime
import hashlib
import os
import random


class Config(models.Model):
Expand Down Expand Up @@ -78,9 +78,8 @@ def gen_key(self):

h = hashlib.sha512()


for i in range(2):
h.update(str(os.random()))
h.update(str(random.SystemRandom().random()))
h.update(str(uuid.uuid4()))
h.update(str(datetime.datetime.now()))
h.update(str(self.pk))
Expand Down

0 comments on commit 806cf61

Please sign in to comment.