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

Collisions when generating addresses #34

Closed
sviridenkovalera opened this issue Oct 18, 2021 · 1 comment
Closed

Collisions when generating addresses #34

sviridenkovalera opened this issue Oct 18, 2021 · 1 comment

Comments

@sviridenkovalera
Copy link

sviridenkovalera commented Oct 18, 2021

Collisions occur because "rand" is used instead of "random_int" in lib/Utils.php

The code section should be replaced with

  public static function randBytes ($ count)
     {
         $ res = "";
         for ($ i = 0; $ i <$ count; $ i ++)
             $ res. = chr (rand (0, 255));
         return $ res;
     }

to the following code or similar

  public static function randBytes ($ count)
     {
         $ res = "";
         for ($ i = 0; $ i <$ count; $ i ++)
             $ res. = chr (random_int(0, 255));
         return $ res;
     }
@ldudzsim
Copy link
Member

Thanks for detecting it. Fixed and released in version 1.0.9

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