Having issue in merchant user creation

bhupendra.doniwal
bhupendra.doniwal Posts: 48 🧑🏻‍🚀 - Cadet

Hi team, 

I'm encountering an error while creating merchant user from merchants->merchantEdit->add merchant user . (this issue occurs sometimes not always) 
Error : "Uncaught exception 'ValueError' with message 'Bcrypt password must not contain null character'" when using the following function: 

password_hash($password, PASSWORD_BCRYPT); 
 

After some debugging, I found that Spryker uses this method: 

public function generateRandomByteString(int $length = 32): string 


{ return random_bytes($length); 

 

It seems that this function can generate null characters, which might be causing the error when used in password hashing.
Do I understand this issue correctly? Can anyone confirm?