CryptEncoderSSHA1 encodes a password with SHA1 with the configured salt.
(salt string)
| 58 | // CryptEncoderSSHA1 encodes a password with SHA1 with the |
| 59 | // configured salt. |
| 60 | func CryptEncoderSSHA1(salt string) func(pass []byte, hash any) []byte { |
| 61 | return func(pass []byte, hash any) []byte { |
| 62 | s := []byte(salt) |
| 63 | p := append(pass, s...) |
| 64 | h := sha1.Sum(p) |
| 65 | return h[:] |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // CryptEncoderSHA256 encodes a password with SHA256 |
| 70 | func CryptEncoderSHA256(pass []byte, hash any) []byte { |
no outgoing calls