CryptEncoderSSHA256 encodes a password with SHA256 with the configured salt
(salt string)
| 75 | // CryptEncoderSSHA256 encodes a password with SHA256 |
| 76 | // with the configured salt |
| 77 | func CryptEncoderSSHA256(salt string) func(pass []byte, hash interface{}) []byte { |
| 78 | return func(pass []byte, hash interface{}) []byte { |
| 79 | s := []byte(salt) |
| 80 | p := append(pass, s...) |
| 81 | h := sha256.Sum256(p) |
| 82 | return h[:] |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // CryptEncoderSHA384 encodes a password with SHA384 |
| 87 | func CryptEncoderSHA384(pass []byte, hash interface{}) []byte { |
no outgoing calls