This project is intended to ease the use of bcrypt package abstracting the developer from using arrays of bytes and all necessary stuff for hashing a string and making it as simple as just to call the need function and passing a string as argument
import (
"fmt"
"github.com/Edmartt/go-password-hasher/hasher"
)
func main(){
myString := "12345"
hashedString := hasher.ConvertToHash(myString)
fmt.Println(hashedString)
}
We'll see some output like this:
import (
"fmt"
"github.com/Edmartt/go-password-hasher/hasher"
)
func main(){
myString := "12345"
hashedString := hasher.ConvertToHash(myString)
isTheSame := hasher.CheckHash(hashedString, "12345")
fmt.Println(isTheSame)
}
Our output here would be:
For running test:
go test -v ./tests
Running coverage:
go test -v --coverprofile=coverage.out -coverpkg ./hasher ./tests