* resize uploaded images #309 * fix temp files created in current dire after image test * update mod * missing image test files * fix failed goroutine test on image-resize submit * switch to mockery * missing in mock change * resize by both ResizeWidth and ResizeHeight * add IMAGE_RESIZE params to readme * add latest features to the description * lint: missing file close in image test
13 lines
243 B
Go
13 lines
243 B
Go
package objx
|
|
|
|
import (
|
|
"crypto/sha1"
|
|
"encoding/hex"
|
|
)
|
|
|
|
// HashWithKey hashes the specified string using the security key
|
|
func HashWithKey(data, key string) string {
|
|
d := sha1.Sum([]byte(data + ":" + key))
|
|
return hex.EncodeToString(d[:])
|
|
}
|