Exemplo n.º 1
0
        string CreateSession(long account, long ticks)
        {
            // X:\jsc.svn\examples\javascript\appengine\SHA1Experiment\SHA1Experiment\ApplicationWebService.cs

            // should encrypt this
            var cookie =
                new
            {
                ticks,
                account,
                comment = "we shall SHA1 this!"
            }.ToString().ToSHA1().ToHexString();

            // be aware: http://www.sha1-lookup.com/index.php?q=28da025b51ac352ea11bee23b56bb04c7766d942


            session.Insert(
                new MySessionQueries.Insert
            {
                ticks   = ticks,
                cookie  = cookie,
                account = account
            }
                );

            Console.WriteLine("CreateSession: " + new { cookie });

            return(cookie);
        }