Can you create a new user with pre-hashed password

Hi Guys, I am am new to MongoDB and coming from Postgresql. I auto-build Linux distros for company teams and was wondering if there is a way to create a new user in MongoDB via scripting that doesn’t require a clear-text password or prompt (as its an unattended build). I have other workarounds, but I believe in older versions of mongoDB you could use an offline pre-hashed created password, but it looks like in 5.0 that’s been removed?

For postgres I can have a fully automated setup without any clear-text passwords anywhere in the CI pipeline so i assume I have missed something obvious for mongodb, or is it much more complicated now and requires an SDK/library to create the hashed password and use with db.createUser()

I’m currently testing with mongo shell, but am open to using any programming lanquages, command line tools.