12 lines
336 B
Go
12 lines
336 B
Go
package ports
|
|
|
|
// CodeHasher hashes cleartext confirmation codes and compares later user input
|
|
// against stored hashes.
|
|
type CodeHasher interface {
|
|
// Hash returns the stored representation for code.
|
|
Hash(code string) ([]byte, error)
|
|
|
|
// Compare reports whether hash matches code.
|
|
Compare(hash []byte, code string) (bool, error)
|
|
}
|