예제 #1
0
파일: TOTP.cs 프로젝트: 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);
        }
예제 #2
0
파일: TOTP.cs 프로젝트: 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;
        }