# fk-htpasswd **Repository Path**: g-devops/fk-htpasswd ## Basic Information - **Project Name**: fk-htpasswd - **Description**: go-htpasswd Golang版htpasswd生成器,免lib库依赖跨发行版 - **Primary Language**: Go - **License**: MIT - **Default Branch**: sam-custom - **Homepage**: https://github.com/foomo/htpasswd - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-30 - **Last Updated**: 2023-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![Travis CI](https://travis-ci.org/foomo/htpasswd.svg?branch=master) # This is a simple utility library to manipulate htpasswd files If you want to authenticate against a htpasswd file use something like https://github.com/abbot/go-http-auth . ## Supported hashing algorithms: - apr1 (do not use except for legacy support situations) - sha (do not use except for legacy support situations) - bcrypt ## This is what you can Set user credentials in a htpasswd file: ```Go file := "/tmp/demo.htpasswd" name := "joe" password := "secret" err := htpasswd.SetPassword(file, name, password, htpasswd.HashBCrypt) ``` Remove a user: ```Go err := htpasswd.RemoveUser(file, name) ``` Read user hash table: ```Go passwords, err := htpasswd.ParseHtpasswdFile(file) ``` Have fun.