Skip to content

Commit 8985d5a

Browse files
author
Yaroslav Vodvud
committed
tried to fix fingerprint
1 parent 640cd8b commit 8985d5a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

zklib/ZKLib.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ public function setUser($uid, $userid, $name, $password, $role = Util::LEVEL_USE
237237

238238
/**
239239
* Get fingerprint data array by UID
240+
* TODO: Can get data, but don't know how to parse the data. Need more documentation about it...
240241
*
241242
* @param integer $uid Unique ID (max 65535)
242243
* @return array Binary fingerprint data array (where key is finger ID (0-9))

zklib/src/Fingerprint.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
class Fingerprint
88
{
99
/**
10+
* TODO: Can get data, but don't know how to parse the data. Need more documentation about it...
11+
*
1012
* @param ZKLib $self
1113
* @param integer $uid Unique Employee ID in ZK device
1214
* @return array Binary fingerprint data array (where key is finger ID (0-9))
@@ -54,10 +56,10 @@ private function _getFinger(ZKLib $self, $uid, $finger)
5456
$data = Util::recData($self, 10, false);
5557

5658
if (!empty($data)) {
57-
$templateSize = strlen($data) + 6;
59+
$templateSize = strlen($data);
5860
$prefix = chr($templateSize % 256) . chr(round($templateSize / 256)) . $byte1 . $byte2 . chr($finger) . chr(1);
5961
$data = $prefix . $data;
60-
if (strlen($data) > 6) {
62+
if (strlen($templateSize) > 0) {
6163
$ret['size'] = $templateSize;
6264
$ret['tpl'] = $data;
6365
}

0 commit comments

Comments
 (0)