Sha256: 42d38f71cf705e9da12900e29144818f39b356645c75f1c8b1713a9a288155ca

Contents?: true

Size: 268 Bytes

Versions: 1

Compression:

Stored size: 268 Bytes

Contents

require "otp/base"

module OTP
  class TOTP < OTP::Base
    attr_accessor :period, :time

    def initialize(*args)
      super
      self.period = 30
      self.time = nil
    end

    def moving_factor
      return (time || Time.now).to_i / period
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
otp-0.0.2 lib/otp/totp.rb