Use whole array as hash
This commit is contained in:
parent
6a8818dab6
commit
83c36f00bf
@ -1,10 +1,6 @@
|
|||||||
package bcrypt
|
package bcrypt
|
||||||
|
|
||||||
import (
|
import "golang.org/x/crypto/bcrypt"
|
||||||
"bytes"
|
|
||||||
|
|
||||||
"golang.org/x/crypto/bcrypt"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Verifier verifys passwords using Bcrypt
|
// Verifier verifys passwords using Bcrypt
|
||||||
type Verifier struct {
|
type Verifier struct {
|
||||||
@ -22,6 +18,6 @@ func (bv *Verifier) Hash(password string) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
idx := bytes.IndexByte(hash, 0)
|
|
||||||
return string(hash[:idx]), nil
|
return string(hash[:]), nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user