why generatePasswordHash in security is very very slow?

why generatePasswordHash in security is very very slow?

I use this : Yii::$app->getSecurity()->generatePasswordHash($passwd);

It use encryption algorithm, I think that’s make it slow.

What do you exactly mean by "very very slow"? Password hashing is intentionally slow but, in normal circumstances, it should take less than one second.

Hello,

I think it is unusually slow.

It takes 1.26 seconds.(My cpu is Corei7-3537U and 8G of ram)

Is another hashing method slow like this?

That’s probably because you have low entropy on your machine, and it’s take a while to get random data to generate salt. It should work much faster on production server with high load.