Class: RQRCode::QRMath

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

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.gexp(n) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/rqrcode/qrcode/qr_math.rb', line 47

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

  while n >= 256
    n = n - 255
  end

  EXP_TABLE[n]
end

.glog(n) ⇒ Object

Raises:



41
42
43
44
# File 'lib/rqrcode/qrcode/qr_math.rb', line 41

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