MCPcopy Create free account
hub / github.com/codemistic/Web-Development / checkModeKanji

Method checkModeKanji

text-to-qr/lib/phpqrcode/qrinput.php:476–491  ·  view source on GitHub ↗

----------------------------------------------------------------------

($size, $data)

Source from the content-addressed store, hash-verified

474
475 //----------------------------------------------------------------------
476 public static function checkModeKanji($size, $data)
477 {
478 if($size & 1)
479 return false;
480
481 for($i=0; $i<$size; $i+=2) {
482 $val = (ord($data[$i]) << 8) | ord($data[$i+1]);
483 if( $val < 0x8140
484 || ($val > 0x9ffc && $val < 0xe040)
485 || $val > 0xebbf) {
486 return false;
487 }
488 }
489
490 return true;
491 }
492
493 /***********************************************************************
494 * Validation

Callers 1

checkMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected