MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / CryptEncoderSSHA256

Function CryptEncoderSSHA256

sqlite3_func_crypt.go:77–84  ·  view source on GitHub ↗

CryptEncoderSSHA256 encodes a password with SHA256 with the configured salt

(salt string)

Source from the content-addressed store, hash-verified

75// CryptEncoderSSHA256 encodes a password with SHA256
76// with the configured salt
77func 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
87func CryptEncoderSHA384(pass []byte, hash interface{}) []byte {

Callers 2

TestCryptEncodersFunction · 0.85
OpenMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestCryptEncodersFunction · 0.68