Create a legacy Apache {SHA} htpasswd line from a password.
The password is UTF-8 encoded, hashed with SHA-1, Base64 encoded without padding, and prefixed with the Apache {SHA} marker beside the username. The result is one line for a file-based Basic Authentication database.
Username: admin Password: secret123
Line: admin:{SHA}8rFPaOuZX6yzocNSh7d41b14VRE=
Username: admin
Hash format: {SHA}
Hash: 8rFPaOuZX6yzocNSh7d41b14VRE=
Apache staging protection, reverse-proxy test gates, and credential migrations create htpasswd lines.