def create_nonce(user, action, offset=0):
  if not user:
    nick = ""
  else:
    try:
      nick = user.nick
    except __HOLE__:
      if settings.MANAGE_PY:
        # extra case to make testing easier
        nick = clean.nick(user)
      else:
        raise
  i = math.ceil(time.time() / 43200)
  i += offset

  nonce = hash_generic(str(i) + action + nick)
  return nonce[-12:-2]
dataset/ETHPy150Open CollabQ/CollabQ/common/util.py/create_nonce