supercaracal / scram-sha-256

Password-encryption tool for PostgreSQL with scram-sha-256
https://supercaracal.github.io/scram-sha-256/
MIT License
59 stars 5 forks source link

Ability to use this as library #8

Closed ChrisJBurns closed 8 months ago

ChrisJBurns commented 8 months ago

To be able to use this in Go programs, can you make this usable as a lib? Preferably just allowing the encryptPassword to be called providing a user passes in the password to hash?

supercaracal commented 8 months ago

Now we can use it like this:

import "github.com/supercaracal/scram-sha-256/pkg/pgpasswd"

func foo(rawPassword []byte) error {
    encrypted, err := pgpasswd.Encrypt(rawPassword)
    if err != nil {
        // ...
    }

    // ...
}