README ¶ hash-go Go abstraction for hashing a string Install $ go get github.com/garavan/hash-go Usage import ( hash "github.com/garavan/hash-go" bcryptHash "github.com/garavan/hash-go/bcrypt" ) type userService struct { hash hash.Hash } func NewUserService(hash hash.Hash) User { return &userService{hash} } func (u *userService) Create(data map[string]string) error { passHashed, err := u.hash.Make(data["password"]) ... } userSrv := NewUserService(bcryptHash.DefaultBcryptHash()) ... Methods bcrypt Test $ go test ./... Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type Hash Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Hash ¶ type Hash interface { Make(s string) (string, error) Check(s, hash string) bool } Hash hashing string Source Files ¶ View all Source files hash.go Directories ¶ Show internal Expand all Path Synopsis bcrypt Click to show internal directories. Click to hide internal directories.