Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fix the ID of a registered user? #210

Open
musahcoding opened this issue Apr 29, 2024 · 1 comment
Open

How to fix the ID of a registered user? #210

musahcoding opened this issue Apr 29, 2024 · 1 comment

Comments

@musahcoding
Copy link

We have assigned ID of the users in an scattered manner where we assigned more than 65535 to about 5K of users. Now we cannot create any more users as the limit has reached.

We are thinking about a solution to keep the fingerprint of existing users and somehow change their IDs to start from 1 and assigned continuous IDs.

To do that, would you please let us know if any of the followings are possible?

  1. Update the ID of a user
  2. Copy the user with the fingerprint data to a new user with the desired ID and then delete the old one. Deleting and creating a new user without the fingerprint is possible already.

Thanks in advance.

@core-burner
Copy link

core-burner commented Aug 18, 2024

You can
def save_user_template(self, user, fingers=[]):
"""
save user and template

    :param user: user
    :param fingers: list of finger. (The maximum index 0-9)
    """

#temp_id is template id
def enroll_user(self, uid=0, temp_id=0, user_id=''):
"""
start enroll user

    :param uid: uid
    :param temp_id: template id

For cleaning old user records you can use delete_user after #218
Enroll should work up to I(which is approximately 4 million)
command_string = pack('<Ib', int(user_id), temp_id)
If you are talking about template_id, that's another story, template_id supports up to a byte only, so keep it clean.
Given these solutions, if there are no further questions or issues, I suggest closing this issue as the provided approach seems sufficient to handle the user ID management and fingerprint data.
Closes #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants