Exemplo n.º 1
0
Arquivo: TOTP.cs Projeto: nrag/yapper
        public bool Verify(int otp)
        {
            long timeStamp         = new Unixtime().ToTimeStamp();
            long numberOfIntervals = this.NumberOfIntervals(timeStamp);

            for (int i = 0; i < PasswordValidIntervals; i++)
            {
                if (this.GenerateOTP(numberOfIntervals - i) == otp)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
Arquivo: TOTP.cs Projeto: nrag/yapper
        public bool Verify(int otp)
        {
            long timeStamp = new Unixtime().ToTimeStamp();
            long numberOfIntervals = this.NumberOfIntervals(timeStamp);

            for (int i = 0; i < PasswordValidIntervals; i++)
            {
                if (this.GenerateOTP(numberOfIntervals - i) == otp)
                {
                    return true;
                }
            }

            return false;
        }