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

Method checkModeKanji

text-to-qr/lib/phpqrcode/phpqrcode.php:1489–1504  ·  view source on GitHub ↗

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

($size, $data)

Source from the content-addressed store, hash-verified

1487
1488 //----------------------------------------------------------------------
1489 public static function checkModeKanji($size, $data)
1490 {
1491 if($size & 1)
1492 return false;
1493
1494 for($i=0; $i<$size; $i+=2) {
1495 $val = (ord($data[$i]) << 8) | ord($data[$i+1]);
1496 if( $val < 0x8140
1497 || ($val > 0x9ffc && $val < 0xe040)
1498 || $val > 0xebbf) {
1499 return false;
1500 }
1501 }
1502
1503 return true;
1504 }
1505
1506 /***********************************************************************
1507 * Validation

Callers 1

checkMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected