<?php $key = pack('c*', 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff); $sig = hash_hmac('sha256', "t=HelloWorld&r=10", $key); echo '<img src="http://mqr.kr/qr/?t=HelloWorld&r=10&sign='.$sig.'"/>'; ?>
<?php $key = pack('c*', 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff); $text = date('Y.m.d H:i:s'); $query = 't='.urlencode($text).'&r=10&j=1&m=20&lb=fccd13<=ed1e2e&rt=155ca2'; $sig = hash_hmac('sha256', $query, $key); echo '<img src="http://mqr.kr/qr/?'.htmlentities($query).'&sign='.$sig.'"/>'; ?>
<?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } ?> <?php $key = pack('c*', 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff); $text = curPageURL(); $query = 't='.urlencode($text).'&r=10&j=1&m=20&lb=fccd13<=ed1e2e&rt=155ca2'; $sig = hash_hmac('sha256', $query, $key); echo '<img src="http://mqr.kr/qr/?'.htmlentities($query).'&sign='.$sig.'"/>'; ?>