chillerlan-QRCode-Common-ReedSolomonDecoder.html 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. </ul>
  59. </nav>
  60. </header>
  61. <main class="phpdocumentor">
  62. <div class="phpdocumentor-section">
  63. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  64. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  65. Menu
  66. </label>
  67. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  68. <section class="phpdocumentor-sidebar__category">
  69. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  70. <h4 class="phpdocumentor-sidebar__root-namespace">
  71. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  72. </h4>
  73. <ul class="phpdocumentor-list">
  74. <li>
  75. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  76. </li>
  77. <li>
  78. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  79. </li>
  80. </ul>
  81. </section>
  82. <section class="phpdocumentor-sidebar__category">
  83. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  84. <h4 class="phpdocumentor-sidebar__root-namespace">
  85. <a href="packages/Application.html" class="">Application</a>
  86. </h4>
  87. </section>
  88. <section class="phpdocumentor-sidebar__category">
  89. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  90. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  91. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  92. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  93. </section>
  94. <section class="phpdocumentor-sidebar__category">
  95. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  96. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  97. </section>
  98. </aside>
  99. <div class="phpdocumentor-column -nine phpdocumentor-content">
  100. <section>
  101. <ul class="phpdocumentor-breadcrumbs">
  102. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  103. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  104. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-common.html">Common</a></li>
  105. </ul>
  106. <article class="phpdocumentor-element -class">
  107. <h2 class="phpdocumentor-content__title">
  108. ReedSolomonDecoder
  109. <div class="phpdocumentor-element__package">
  110. in package
  111. <ul class="phpdocumentor-breadcrumbs">
  112. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  113. </ul>
  114. </div>
  115. </h2>
  116. <div class="phpdocumentor-label-line">
  117. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
  118. </div>
  119. <aside class="phpdocumentor-element-found-in">
  120. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  121. :
  122. <span class="phpdocumentor-element-found-in__line">35</span>
  123. </aside>
  124. <p class="phpdocumentor-summary">Implements Reed-Solomon decoding</p>
  125. <section class="phpdocumentor-description"><p>The algorithm will not be explained here, but the following references were helpful
  126. in creating this implementation:</p>
  127. <ul>
  128. <li>Bruce Maggs &quot;Decoding Reed-Solomon Codes&quot; (see discussion of Forney's Formula)
  129. http://www.cs.cmu.edu/afs/cs.cmu.edu/project/pscico-guyb/realworld/www/rs_decode.ps</li>
  130. <li>J.I. Hall. &quot;Chapter 5. Generalized Reed-Solomon Codes&quot; (see discussion of Euclidean algorithm)
  131. https://users.math.msu.edu/users/halljo/classes/codenotes/GRS.pdf</li>
  132. </ul>
  133. <p>Much credit is due to William Rucklidge since portions of this code are an indirect
  134. port of his C++ Reed-Solomon implementation.</p>
  135. </section>
  136. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  137. Tags
  138. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
  139. </h5>
  140. <dl class="phpdocumentor-tag-list">
  141. <dt class="phpdocumentor-tag-list__entry">
  142. <span class="phpdocumentor-tag__name">author</span>
  143. </dt>
  144. <dd class="phpdocumentor-tag-list__definition">
  145. <section class="phpdocumentor-description"><p>Sean Owen</p>
  146. </section>
  147. </dd>
  148. <dt class="phpdocumentor-tag-list__entry">
  149. <span class="phpdocumentor-tag__name">author</span>
  150. </dt>
  151. <dd class="phpdocumentor-tag-list__definition">
  152. <section class="phpdocumentor-description"><p>William Rucklidge</p>
  153. </section>
  154. </dd>
  155. <dt class="phpdocumentor-tag-list__entry">
  156. <span class="phpdocumentor-tag__name">author</span>
  157. </dt>
  158. <dd class="phpdocumentor-tag-list__definition">
  159. <section class="phpdocumentor-description"><p>sanfordsquires</p>
  160. </section>
  161. </dd>
  162. </dl>
  163. <h3 id="toc">
  164. Table of Contents
  165. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  166. </h3>
  167. <h4 id="toc-properties">
  168. Properties
  169. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  170. </h4>
  171. <dl class="phpdocumentor-table-of-contents">
  172. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  173. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#property_eccLevel">$eccLevel</a>
  174. <span>
  175. &nbsp;: <a href="classes/chillerlan-QRCode-Common-EccLevel.html"><abbr title="\chillerlan\QRCode\Common\EccLevel">EccLevel</abbr></a> </span>
  176. </dt>
  177. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  178. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#property_version">$version</a>
  179. <span>
  180. &nbsp;: <a href="classes/chillerlan-QRCode-Common-Version.html"><abbr title="\chillerlan\QRCode\Common\Version">Version</abbr></a> </span>
  181. </dt>
  182. </dl>
  183. <h4 id="toc-methods">
  184. Methods
  185. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  186. </h4>
  187. <dl class="phpdocumentor-table-of-contents">
  188. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  189. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method___construct">__construct()</a>
  190. <span>
  191. &nbsp;: mixed </span>
  192. </dt>
  193. <dd>ReedSolomonDecoder constructor</dd>
  194. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  195. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_decode">decode()</a>
  196. <span>
  197. &nbsp;: <a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a> </span>
  198. </dt>
  199. <dd>Error-correct and copy data blocks together into a stream of bytes</dd>
  200. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  201. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_correctErrors">correctErrors()</a>
  202. <span>
  203. &nbsp;: array&lt;string|int, mixed&gt; </span>
  204. </dt>
  205. <dd>Given data and error-correction codewords received, possibly corrupted by errors, attempts to
  206. correct the errors in-place using Reed-Solomon error correction.</dd>
  207. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  208. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_decodeWords">decodeWords()</a>
  209. <span>
  210. &nbsp;: array&lt;string|int, int&gt; </span>
  211. </dt>
  212. <dd>Decodes given set of received codewords, which include both data and error-correction
  213. codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place,
  214. in the input.</dd>
  215. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  216. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_deinterleaveRawBytes">deinterleaveRawBytes()</a>
  217. <span>
  218. &nbsp;: array&lt;string|int, mixed&gt; </span>
  219. </dt>
  220. <dd>When QR Codes use multiple data blocks, they are actually interleaved.</dd>
  221. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  222. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_findErrorLocations">findErrorLocations()</a>
  223. <span>
  224. &nbsp;: array&lt;string|int, mixed&gt; </span>
  225. </dt>
  226. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  227. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_findErrorMagnitudes">findErrorMagnitudes()</a>
  228. <span>
  229. &nbsp;: array&lt;string|int, mixed&gt; </span>
  230. </dt>
  231. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  232. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_runEuclideanAlgorithm">runEuclideanAlgorithm()</a>
  233. <span>
  234. &nbsp;: array&lt;string|int, <a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a>&gt; </span>
  235. </dt>
  236. </dl>
  237. <section class="phpdocumentor-properties">
  238. <h3 class="phpdocumentor-elements__header" id="properties">
  239. Properties
  240. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  241. </h3>
  242. <article
  243. class="
  244. phpdocumentor-element
  245. -property
  246. -private
  247. "
  248. >
  249. <h4 class="phpdocumentor-element__name" id="property_eccLevel">
  250. $eccLevel
  251. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#property_eccLevel" class="headerlink"><i class="fas fa-link"></i></a>
  252. <span class="phpdocumentor-element__modifiers">
  253. </span>
  254. </h4>
  255. <aside class="phpdocumentor-element-found-in">
  256. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  257. :
  258. <span class="phpdocumentor-element-found-in__line">38</span>
  259. </aside>
  260. <code class="phpdocumentor-code phpdocumentor-signature ">
  261. <span class="phpdocumentor-signature__visibility">private</span>
  262. <span class="phpdocumentor-signature__type"><a href="classes/chillerlan-QRCode-Common-EccLevel.html"><abbr title="\chillerlan\QRCode\Common\EccLevel">EccLevel</abbr></a></span>
  263. <span class="phpdocumentor-signature__name">$eccLevel</span>
  264. </code>
  265. </article>
  266. <article
  267. class="
  268. phpdocumentor-element
  269. -property
  270. -private
  271. "
  272. >
  273. <h4 class="phpdocumentor-element__name" id="property_version">
  274. $version
  275. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#property_version" class="headerlink"><i class="fas fa-link"></i></a>
  276. <span class="phpdocumentor-element__modifiers">
  277. </span>
  278. </h4>
  279. <aside class="phpdocumentor-element-found-in">
  280. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  281. :
  282. <span class="phpdocumentor-element-found-in__line">37</span>
  283. </aside>
  284. <code class="phpdocumentor-code phpdocumentor-signature ">
  285. <span class="phpdocumentor-signature__visibility">private</span>
  286. <span class="phpdocumentor-signature__type"><a href="classes/chillerlan-QRCode-Common-Version.html"><abbr title="\chillerlan\QRCode\Common\Version">Version</abbr></a></span>
  287. <span class="phpdocumentor-signature__name">$version</span>
  288. </code>
  289. </article>
  290. </section>
  291. <section class="phpdocumentor-methods">
  292. <h3 class="phpdocumentor-elements__header" id="methods">
  293. Methods
  294. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  295. </h3>
  296. <article
  297. class="phpdocumentor-element
  298. -method
  299. -public
  300. "
  301. >
  302. <h4 class="phpdocumentor-element__name" id="method___construct">
  303. __construct()
  304. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  305. </h4>
  306. <aside class="phpdocumentor-element-found-in">
  307. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  308. :
  309. <span class="phpdocumentor-element-found-in__line">43</span>
  310. </aside>
  311. <p class="phpdocumentor-summary">ReedSolomonDecoder constructor</p>
  312. <code class="phpdocumentor-code phpdocumentor-signature ">
  313. <span class="phpdocumentor-signature__visibility">public</span>
  314. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-Version.html"><abbr title="\chillerlan\QRCode\Common\Version">Version</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$version</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-EccLevel.html"><abbr title="\chillerlan\QRCode\Common\EccLevel">EccLevel</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$eccLevel</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  315. <div class="phpdocumentor-label-line">
  316. </div>
  317. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  318. <dl class="phpdocumentor-argument-list">
  319. <dt class="phpdocumentor-argument-list__entry">
  320. <span class="phpdocumentor-signature__argument__name">$version</span>
  321. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-Version.html"><abbr title="\chillerlan\QRCode\Common\Version">Version</abbr></a></span>
  322. </dt>
  323. <dd class="phpdocumentor-argument-list__definition">
  324. </dd>
  325. <dt class="phpdocumentor-argument-list__entry">
  326. <span class="phpdocumentor-signature__argument__name">$eccLevel</span>
  327. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-EccLevel.html"><abbr title="\chillerlan\QRCode\Common\EccLevel">EccLevel</abbr></a></span>
  328. </dt>
  329. <dd class="phpdocumentor-argument-list__definition">
  330. </dd>
  331. </dl>
  332. </article>
  333. <article
  334. class="phpdocumentor-element
  335. -method
  336. -public
  337. "
  338. >
  339. <h4 class="phpdocumentor-element__name" id="method_decode">
  340. decode()
  341. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_decode" class="headerlink"><i class="fas fa-link"></i></a>
  342. </h4>
  343. <aside class="phpdocumentor-element-found-in">
  344. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  345. :
  346. <span class="phpdocumentor-element-found-in__line">51</span>
  347. </aside>
  348. <p class="phpdocumentor-summary">Error-correct and copy data blocks together into a stream of bytes</p>
  349. <code class="phpdocumentor-code phpdocumentor-signature ">
  350. <span class="phpdocumentor-signature__visibility">public</span>
  351. <span class="phpdocumentor-signature__name">decode</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$rawCodewords</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a></span></code>
  352. <div class="phpdocumentor-label-line">
  353. </div>
  354. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  355. <dl class="phpdocumentor-argument-list">
  356. <dt class="phpdocumentor-argument-list__entry">
  357. <span class="phpdocumentor-signature__argument__name">$rawCodewords</span>
  358. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  359. </dt>
  360. <dd class="phpdocumentor-argument-list__definition">
  361. </dd>
  362. </dl>
  363. <section>
  364. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  365. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Common-BitBuffer.html"><abbr title="\chillerlan\QRCode\Common\BitBuffer">BitBuffer</abbr></a></span>
  366. </section>
  367. </article>
  368. <article
  369. class="phpdocumentor-element
  370. -method
  371. -private
  372. "
  373. >
  374. <h4 class="phpdocumentor-element__name" id="method_correctErrors">
  375. correctErrors()
  376. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_correctErrors" class="headerlink"><i class="fas fa-link"></i></a>
  377. </h4>
  378. <aside class="phpdocumentor-element-found-in">
  379. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  380. :
  381. <span class="phpdocumentor-element-found-in__line">141</span>
  382. </aside>
  383. <p class="phpdocumentor-summary">Given data and error-correction codewords received, possibly corrupted by errors, attempts to
  384. correct the errors in-place using Reed-Solomon error correction.</p>
  385. <code class="phpdocumentor-code phpdocumentor-signature ">
  386. <span class="phpdocumentor-signature__visibility">private</span>
  387. <span class="phpdocumentor-signature__name">correctErrors</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$codewordBytes</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$numDataCodewords</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
  388. <div class="phpdocumentor-label-line">
  389. </div>
  390. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  391. <dl class="phpdocumentor-argument-list">
  392. <dt class="phpdocumentor-argument-list__entry">
  393. <span class="phpdocumentor-signature__argument__name">$codewordBytes</span>
  394. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  395. </dt>
  396. <dd class="phpdocumentor-argument-list__definition">
  397. </dd>
  398. <dt class="phpdocumentor-argument-list__entry">
  399. <span class="phpdocumentor-signature__argument__name">$numDataCodewords</span>
  400. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  401. </dt>
  402. <dd class="phpdocumentor-argument-list__definition">
  403. </dd>
  404. </dl>
  405. <section>
  406. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  407. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  408. </section>
  409. </article>
  410. <article
  411. class="phpdocumentor-element
  412. -method
  413. -private
  414. "
  415. >
  416. <h4 class="phpdocumentor-element__name" id="method_decodeWords">
  417. decodeWords()
  418. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_decodeWords" class="headerlink"><i class="fas fa-link"></i></a>
  419. </h4>
  420. <aside class="phpdocumentor-element-found-in">
  421. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  422. :
  423. <span class="phpdocumentor-element-found-in__line">171</span>
  424. </aside>
  425. <p class="phpdocumentor-summary">Decodes given set of received codewords, which include both data and error-correction
  426. codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place,
  427. in the input.</p>
  428. <code class="phpdocumentor-code phpdocumentor-signature ">
  429. <span class="phpdocumentor-signature__visibility">private</span>
  430. <span class="phpdocumentor-signature__name">decodeWords</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$received</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$numEccCodewords</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, int&gt;</span></code>
  431. <div class="phpdocumentor-label-line">
  432. </div>
  433. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  434. <dl class="phpdocumentor-argument-list">
  435. <dt class="phpdocumentor-argument-list__entry">
  436. <span class="phpdocumentor-signature__argument__name">$received</span>
  437. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  438. </dt>
  439. <dd class="phpdocumentor-argument-list__definition">
  440. <section class="phpdocumentor-description"><p>data and error-correction codewords</p>
  441. </section>
  442. </dd>
  443. <dt class="phpdocumentor-argument-list__entry">
  444. <span class="phpdocumentor-signature__argument__name">$numEccCodewords</span>
  445. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  446. </dt>
  447. <dd class="phpdocumentor-argument-list__definition">
  448. <section class="phpdocumentor-description"><p>number of error-correction codewords available</p>
  449. </section>
  450. </dd>
  451. </dl>
  452. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  453. Tags
  454. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_decodeWords#tags" class="headerlink"><i class="fas fa-link"></i></a>
  455. </h5>
  456. <dl class="phpdocumentor-tag-list">
  457. <dt class="phpdocumentor-tag-list__entry">
  458. <span class="phpdocumentor-tag__name">throws</span>
  459. </dt>
  460. <dd class="phpdocumentor-tag-list__definition">
  461. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QRCodeException.html"><abbr title="\chillerlan\QRCode\QRCodeException">QRCodeException</abbr></a></span>
  462. <section class="phpdocumentor-description"><p>if decoding fails for any reason</p>
  463. </section>
  464. </dd>
  465. </dl>
  466. <section>
  467. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  468. <span class="phpdocumentor-signature__response_type">array&lt;string|int, int&gt;</span>
  469. </section>
  470. </article>
  471. <article
  472. class="phpdocumentor-element
  473. -method
  474. -private
  475. "
  476. >
  477. <h4 class="phpdocumentor-element__name" id="method_deinterleaveRawBytes">
  478. deinterleaveRawBytes()
  479. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_deinterleaveRawBytes" class="headerlink"><i class="fas fa-link"></i></a>
  480. </h4>
  481. <aside class="phpdocumentor-element-found-in">
  482. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  483. :
  484. <span class="phpdocumentor-element-found-in__line">73</span>
  485. </aside>
  486. <p class="phpdocumentor-summary">When QR Codes use multiple data blocks, they are actually interleaved.</p>
  487. <code class="phpdocumentor-code phpdocumentor-signature ">
  488. <span class="phpdocumentor-signature__visibility">private</span>
  489. <span class="phpdocumentor-signature__name">deinterleaveRawBytes</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$rawCodewords</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
  490. <div class="phpdocumentor-label-line">
  491. </div>
  492. <section class="phpdocumentor-description"><p>That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This
  493. method will separate the data into original blocks.</p>
  494. </section>
  495. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  496. <dl class="phpdocumentor-argument-list">
  497. <dt class="phpdocumentor-argument-list__entry">
  498. <span class="phpdocumentor-signature__argument__name">$rawCodewords</span>
  499. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  500. </dt>
  501. <dd class="phpdocumentor-argument-list__definition">
  502. </dd>
  503. </dl>
  504. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  505. Tags
  506. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_deinterleaveRawBytes#tags" class="headerlink"><i class="fas fa-link"></i></a>
  507. </h5>
  508. <dl class="phpdocumentor-tag-list">
  509. <dt class="phpdocumentor-tag-list__entry">
  510. <span class="phpdocumentor-tag__name">throws</span>
  511. </dt>
  512. <dd class="phpdocumentor-tag-list__definition">
  513. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Decoder-QRCodeDecoderException.html"><abbr title="\chillerlan\QRCode\Decoder\QRCodeDecoderException">QRCodeDecoderException</abbr></a></span>
  514. </dd>
  515. </dl>
  516. <section>
  517. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  518. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  519. </section>
  520. </article>
  521. <article
  522. class="phpdocumentor-element
  523. -method
  524. -private
  525. "
  526. >
  527. <h4 class="phpdocumentor-element__name" id="method_findErrorLocations">
  528. findErrorLocations()
  529. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_findErrorLocations" class="headerlink"><i class="fas fa-link"></i></a>
  530. </h4>
  531. <aside class="phpdocumentor-element-found-in">
  532. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  533. :
  534. <span class="phpdocumentor-element-found-in__line">260</span>
  535. </aside>
  536. <code class="phpdocumentor-code phpdocumentor-signature ">
  537. <span class="phpdocumentor-signature__visibility">private</span>
  538. <span class="phpdocumentor-signature__name">findErrorLocations</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$errorLocator</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
  539. <div class="phpdocumentor-label-line">
  540. </div>
  541. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  542. <dl class="phpdocumentor-argument-list">
  543. <dt class="phpdocumentor-argument-list__entry">
  544. <span class="phpdocumentor-signature__argument__name">$errorLocator</span>
  545. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a></span>
  546. </dt>
  547. <dd class="phpdocumentor-argument-list__definition">
  548. </dd>
  549. </dl>
  550. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  551. Tags
  552. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_findErrorLocations#tags" class="headerlink"><i class="fas fa-link"></i></a>
  553. </h5>
  554. <dl class="phpdocumentor-tag-list">
  555. <dt class="phpdocumentor-tag-list__entry">
  556. <span class="phpdocumentor-tag__name">throws</span>
  557. </dt>
  558. <dd class="phpdocumentor-tag-list__definition">
  559. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QRCodeException.html"><abbr title="\chillerlan\QRCode\QRCodeException">QRCodeException</abbr></a></span>
  560. </dd>
  561. </dl>
  562. <section>
  563. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  564. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  565. </section>
  566. </article>
  567. <article
  568. class="phpdocumentor-element
  569. -method
  570. -private
  571. "
  572. >
  573. <h4 class="phpdocumentor-element__name" id="method_findErrorMagnitudes">
  574. findErrorMagnitudes()
  575. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_findErrorMagnitudes" class="headerlink"><i class="fas fa-link"></i></a>
  576. </h4>
  577. <aside class="phpdocumentor-element-found-in">
  578. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  579. :
  580. <span class="phpdocumentor-element-found-in__line">288</span>
  581. </aside>
  582. <code class="phpdocumentor-code phpdocumentor-signature ">
  583. <span class="phpdocumentor-signature__visibility">private</span>
  584. <span class="phpdocumentor-signature__name">findErrorMagnitudes</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$errorEvaluator</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$errorLocations</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
  585. <div class="phpdocumentor-label-line">
  586. </div>
  587. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  588. <dl class="phpdocumentor-argument-list">
  589. <dt class="phpdocumentor-argument-list__entry">
  590. <span class="phpdocumentor-signature__argument__name">$errorEvaluator</span>
  591. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a></span>
  592. </dt>
  593. <dd class="phpdocumentor-argument-list__definition">
  594. </dd>
  595. <dt class="phpdocumentor-argument-list__entry">
  596. <span class="phpdocumentor-signature__argument__name">$errorLocations</span>
  597. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  598. </dt>
  599. <dd class="phpdocumentor-argument-list__definition">
  600. </dd>
  601. </dl>
  602. <section>
  603. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  604. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  605. </section>
  606. </article>
  607. <article
  608. class="phpdocumentor-element
  609. -method
  610. -private
  611. "
  612. >
  613. <h4 class="phpdocumentor-element__name" id="method_runEuclideanAlgorithm">
  614. runEuclideanAlgorithm()
  615. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_runEuclideanAlgorithm" class="headerlink"><i class="fas fa-link"></i></a>
  616. </h4>
  617. <aside class="phpdocumentor-element-found-in">
  618. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/ReedSolomonDecoder.php"><a href="files/src-common-reedsolomondecoder.html"><abbr title="src/Common/ReedSolomonDecoder.php">ReedSolomonDecoder.php</abbr></a></abbr>
  619. :
  620. <span class="phpdocumentor-element-found-in__line">216</span>
  621. </aside>
  622. <code class="phpdocumentor-code phpdocumentor-signature ">
  623. <span class="phpdocumentor-signature__visibility">private</span>
  624. <span class="phpdocumentor-signature__name">runEuclideanAlgorithm</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$a</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$b</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$z</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, <a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a>&gt;</span></code>
  625. <div class="phpdocumentor-label-line">
  626. </div>
  627. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  628. <dl class="phpdocumentor-argument-list">
  629. <dt class="phpdocumentor-argument-list__entry">
  630. <span class="phpdocumentor-signature__argument__name">$a</span>
  631. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a></span>
  632. </dt>
  633. <dd class="phpdocumentor-argument-list__definition">
  634. </dd>
  635. <dt class="phpdocumentor-argument-list__entry">
  636. <span class="phpdocumentor-signature__argument__name">$b</span>
  637. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a></span>
  638. </dt>
  639. <dd class="phpdocumentor-argument-list__definition">
  640. </dd>
  641. <dt class="phpdocumentor-argument-list__entry">
  642. <span class="phpdocumentor-signature__argument__name">$z</span>
  643. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  644. </dt>
  645. <dd class="phpdocumentor-argument-list__definition">
  646. </dd>
  647. </dl>
  648. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  649. Tags
  650. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_runEuclideanAlgorithm#tags" class="headerlink"><i class="fas fa-link"></i></a>
  651. </h5>
  652. <dl class="phpdocumentor-tag-list">
  653. <dt class="phpdocumentor-tag-list__entry">
  654. <span class="phpdocumentor-tag__name">throws</span>
  655. </dt>
  656. <dd class="phpdocumentor-tag-list__definition">
  657. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QRCodeException.html"><abbr title="\chillerlan\QRCode\QRCodeException">QRCodeException</abbr></a></span>
  658. </dd>
  659. </dl>
  660. <section>
  661. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  662. <span class="phpdocumentor-signature__response_type">array&lt;string|int, <a href="classes/chillerlan-QRCode-Common-GenericGFPoly.html"><abbr title="\chillerlan\QRCode\Common\GenericGFPoly">GenericGFPoly</abbr></a>&gt;</span>
  663. &mdash;
  664. <section class="phpdocumentor-description"><p>[sigma, omega]</p>
  665. </section>
  666. </section>
  667. </article>
  668. </section>
  669. <div class="phpdocumentor-modal" id="source-view">
  670. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  671. <div class="phpdocumentor-modal-container">
  672. <div class="phpdocumentor-modal-content">
  673. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Common/ReedSolomonDecoder.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  674. </div>
  675. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  676. </div>
  677. </div>
  678. <script type="text/javascript">
  679. (function () {
  680. function loadExternalCodeSnippet(el, url, line) {
  681. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  682. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  683. const language = 'php';
  684. const code = document.createElement('code');
  685. code.className = 'language-' + language;
  686. pre.textContent = '';
  687. pre.setAttribute('data-line', line)
  688. code.textContent = 'Loading…';
  689. pre.appendChild(code);
  690. var xhr = new XMLHttpRequest();
  691. xhr.open('GET', src, true);
  692. xhr.onreadystatechange = function () {
  693. if (xhr.readyState !== 4) {
  694. return;
  695. }
  696. if (xhr.status < 400 && xhr.responseText) {
  697. code.textContent = xhr.responseText;
  698. Prism.highlightElement(code);
  699. return;
  700. }
  701. if (xhr.status === 404) {
  702. code.textContent = '✖ Error: File could not be found';
  703. return;
  704. }
  705. if (xhr.status >= 400) {
  706. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  707. return;
  708. }
  709. code.textContent = '✖ Error: An unknown error occurred';
  710. };
  711. xhr.send(null);
  712. });
  713. }
  714. const modalButtons = document.querySelectorAll("[data-modal]");
  715. const openedAsLocalFile = window.location.protocol === 'file:';
  716. if (modalButtons.length > 0 && openedAsLocalFile) {
  717. console.warn(
  718. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  719. 'browsers block XHR requests when a page is opened this way'
  720. );
  721. }
  722. modalButtons.forEach(function (trigger) {
  723. if (openedAsLocalFile) {
  724. trigger.setAttribute("hidden", "hidden");
  725. }
  726. trigger.addEventListener("click", function (event) {
  727. event.preventDefault();
  728. const modal = document.getElementById(trigger.dataset.modal);
  729. if (!modal) {
  730. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  731. return;
  732. }
  733. modal.classList.add("phpdocumentor-modal__open");
  734. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  735. const exits = modal.querySelectorAll("[data-exit-button]");
  736. exits.forEach(function (exit) {
  737. exit.addEventListener("click", function (event) {
  738. event.preventDefault();
  739. modal.classList.remove("phpdocumentor-modal__open");
  740. });
  741. });
  742. });
  743. });
  744. })();
  745. </script>
  746. </article>
  747. </section>
  748. <section class="phpdocumentor-on-this-page__sidebar">
  749. <section class="phpdocumentor-on-this-page__content">
  750. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  751. <ul class="phpdocumentor-list -clean">
  752. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  753. <li>
  754. <ul class="phpdocumentor-list -clean">
  755. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#toc-properties">Properties</a></li>
  756. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#toc-methods">Methods</a></li>
  757. </ul>
  758. </li>
  759. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  760. <li>
  761. <ul class="phpdocumentor-list -clean">
  762. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#property_eccLevel">$eccLevel<a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html"></li>
  763. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#property_version">$version<a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html"></li>
  764. </ul>
  765. </li>
  766. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  767. <li>
  768. <ul class="phpdocumentor-list -clean">
  769. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method___construct">__construct()</a></li>
  770. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_decode">decode()</a></li>
  771. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_correctErrors">correctErrors()</a></li>
  772. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_decodeWords">decodeWords()</a></li>
  773. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_deinterleaveRawBytes">deinterleaveRawBytes()</a></li>
  774. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_findErrorLocations">findErrorLocations()</a></li>
  775. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_findErrorMagnitudes">findErrorMagnitudes()</a></li>
  776. <li><a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#method_runEuclideanAlgorithm">runEuclideanAlgorithm()</a></li>
  777. </ul>
  778. </li>
  779. </ul>
  780. </section>
  781. </section>
  782. </div>
  783. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  784. <section class="phpdocumentor-search-results__dialog">
  785. <header class="phpdocumentor-search-results__header">
  786. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  787. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  788. </header>
  789. <section class="phpdocumentor-search-results__body">
  790. <ul class="phpdocumentor-search-results__entries"></ul>
  791. </section>
  792. </section>
  793. </section>
  794. </div>
  795. <a href="classes/chillerlan-QRCode-Common-ReedSolomonDecoder.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  796. </main>
  797. <script>
  798. cssVars({});
  799. </script>
  800. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  801. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  802. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  803. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  804. </body>
  805. </html>