(request, encoding="utf-8")
return sha("{0:s}{1:s}".format(ip, agent).encode(encoding)).hexdigest()
Create a SHA1 Hash of the User's IP Address and User-Agent
Create a SHA1 Hash of the User's IP Address and User-Agent
Create a SHA1 Hash of the User s IP Address and User - Agent
def who(request, encoding="utf-8"):
    """Create a SHA1 Hash of the User's IP Address and User-Agent"""

    ip = request.remote.ip
    agent = request.headers.get("User-Agent", "")

    return sha("{0:s}{1:s}".format(ip, agent).encode(encoding)).hexdigest()
def who ( request , encoding = "utf-8" ) : ip = request . remote . ip agent = request . headers . get ( "User-Agent" , "" ) return sha ( "{0:s}{1:s}" . format ( ip , agent ) . encode ( encoding ) ) . hexdigest ( )