Skip to content

Commit

Permalink
Add SHA512 HashGeneratorFcn
Browse files Browse the repository at this point in the history
Closes #1.
  • Loading branch information
ianwormsbecker-ssimwave authored and xdg committed Jan 16, 2022
1 parent 2ad5018 commit 0606693
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scram.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package scram
import (
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"fmt"
"hash"

Expand All @@ -29,6 +30,10 @@ var SHA1 HashGeneratorFcn = func() hash.Hash { return sha1.New() }
// to create Client objects configured for SHA-256 hashing.
var SHA256 HashGeneratorFcn = func() hash.Hash { return sha256.New() }

// SHA512 is a function that returns a crypto/sha512 hasher and should be used
// to create Client objects configured for SHA-512 hashing.
var SHA512 HashGeneratorFcn = func() hash.Hash { return sha512.New() }

// NewClient constructs a SCRAM client component based on a given hash.Hash
// factory receiver. This constructor will normalize the username, password
// and authzID via the SASLprep algorithm, as recommended by RFC-5802. If
Expand Down

0 comments on commit 0606693

Please sign in to comment.