fananimi / pyzk

Unofficial library of zkteco fingerprint attendance machine
GNU General Public License v2.0
489 stars 319 forks source link

Increase the limit on the ID of the users #209

Closed musahcoding closed 4 months ago

musahcoding commented 4 months ago

Is your feature request related to a problem? Please describe. We are trying to set some user IDs in the device that is greater than 68 K, but the maximum allowed size is USHRT_MAX = 65535.

Describe the solution you'd like We tried it on K70, and on the device itself, we see the ID as 123456789 is possible to set. It would be wonderful if we can utilize such a large number on through this lib too for IDs.

Describe alternatives you've considered The alternative for us would be to be rebuilt the logic so we assign the IDs continuously from 1 to 65535, but then it would mean re-registering about 5 K of users. I have already asked about those possibilities here: https://github.com/fananimi/pyzk/issues/210

Additional context N/A

kurenai-ryu commented 4 months ago

the user creation is limited by the uid (16 bits, max 65535) but you can set a user_id (32 bits number on small devices, or even a string in bigger ones)

usually, you have a database with the user_id assigned to your users, and a corresponding uid on the specific device. it doesn't have to share the same value. but certain functions requires the uid from the device. also ZK software usually doesn't display the uid value, just the user_id