Class: RQRCodeCore::QRMath

Inherits:
Object
  • Object
show all
Defined in:
lib/rqrcode_core/qrcode/qr_math.rb

Class Method Summary collapse

Class Method Details

.gexp(n) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/rqrcode_core/qrcode/qr_math.rb', line 34

def gexp(n)
  while n < 0
    n += 255
  end

  while n >= 256
    n -= 255
  end

  EXP_TABLE[n]
end

.glog(n) ⇒ Object

Raises:



29
30
31
32
# File 'lib/rqrcode_core/qrcode/qr_math.rb', line 29

def glog(n)
  raise QRCodeRunTimeError, "glog(#{n})" if n < 1
  LOG_TABLE[n]
end