foomo/htpasswd

golang htpasswd utilities

40

stars

15

commits

Go

primary language

May 27, 2026

updated

README

Travis CI

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:

file := "/tmp/demo.htpasswd"
name := "joe"
password := "secret"
err := htpasswd.SetPassword(file, name, password, htpasswd.HashBCrypt)

Remove a user:

err := htpasswd.RemoveUser(file, name)

Read user hash table:

passwords, err := htpasswd.ParseHtpasswdFile(file)

Have fun.

Contributors

janhalfar

11 commits

chennqqi

1 commits

n0madic

1 commits

foomo/htpasswd

golang htpasswd utilities

40

stars

15

commits

Go

primary language

May 27, 2026

updated

README

Travis CI

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:

file := "/tmp/demo.htpasswd"
name := "joe"
password := "secret"
err := htpasswd.SetPassword(file, name, password, htpasswd.HashBCrypt)

Remove a user:

err := htpasswd.RemoveUser(file, name)

Read user hash table:

passwords, err := htpasswd.ParseHtpasswdFile(file)

Have fun.

Contributors

janhalfar

11 commits

chennqqi

1 commits

n0madic

1 commits

Languages

Go

100.0%