2018-03-21 06:59:04 +07:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-03-24 06:44:00 +07:00
|
|
|
from struct import pack #, unpack
|
2018-03-21 06:59:04 +07:00
|
|
|
class Finger(object):
|
|
|
|
def __init__(self, size, uid, fid, valid, template):
|
|
|
|
self.size = size
|
|
|
|
self.uid = uid
|
|
|
|
self.fid = fid
|
|
|
|
self.valid = valid
|
|
|
|
self.template = template
|
2018-03-28 06:32:56 +07:00
|
|
|
self.mark = str(template[:6]).encode("hex")
|
2018-03-24 06:44:00 +07:00
|
|
|
def repack(self):
|
|
|
|
return pack("HHbb%is" % (self.size-6), self.size, self.uid, self.fid, self.valid, self.template)
|
2018-03-21 06:59:04 +07:00
|
|
|
|
|
|
|
def __str__(self):
|
2018-03-28 06:32:56 +07:00
|
|
|
return "<Finger> [u:%i, fid:%i, size:%i v:%i t:%s...]" % (self.uid, self.fid, self.size, self.valid, self.mark)
|
2018-03-21 06:59:04 +07:00
|
|
|
|
|
|
|
def __repr__(self):
|
2018-03-28 06:32:56 +07:00
|
|
|
return "<Finger> [u:%i, fid:%i, size:%i v:%i t:%s...]" % (self.uid, self.fid, self.size, self.valid, self.mark) #.encode('hex')
|