Yes. There are two ways to accomplish this.
If you know the factor ahead of time (it is recorded in a database), then you can set it on import. Use the Import Users API. (You can also use the Create User API if you are creating one user at a time.) With the Import User API, set the factor for each user; they don't have to be the same across all users.
If you don't know the factor ahead of time, you need to create a plugin. Here's a sample plugin.
In the encrypt method, which has this signature: public String encrypt(String password, String salt, int factor), you can ignore the provided factor and use the algorithm you mention to calculate it. You are passed the plaintext password and can examine it for length, characters, etc.
Test and install the custom password hashing plugin into your FusionAuth instance as documented. (If you are running in FusionAuth Cloud, you'll need to open a support ticket with the jar file.)
When importing the user, the factor won't matter, but make sure to set the encryptionScheme to your custom password hashing plugin.
After importing, configure your tenant to rehash users' passwords on login to a more standard factor and hashing scheme. Learn more about that here.