Regarding the security,
const bcryptHashedPassword = bcrypt.hashSync(reversedSHAHash, 5);
Here 5 is the salt round or cost factor.
The total number of rounds/times hashed = 2 ^ (salt rounds). So your implementation hashes the password 32 times. Nowadays, bcrypt libraries use the cost factor of 10 by default, i.e., 1024 rounds.