mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
Added vendor/ dir to remove dependencies on gopkg.in (down Aug 12 2022)
This commit is contained in:
parent
f24d4d8fdb
commit
7a4560762d
913 changed files with 317350 additions and 0 deletions
11
vendor/gopkg.in/hlandau/passlib.v1/abstract/compare.go
generated
vendored
Normal file
11
vendor/gopkg.in/hlandau/passlib.v1/abstract/compare.go
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
package abstract
|
||||
|
||||
import "crypto/subtle"
|
||||
|
||||
// Compares two strings (typicaly password hashes) in a secure, constant-time
|
||||
// fashion. Returns true iff they are equal.
|
||||
func SecureCompare(a, b string) bool {
|
||||
ab := []byte(a)
|
||||
bb := []byte(b)
|
||||
return subtle.ConstantTimeCompare(ab, bb) == 1
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue