mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
13 lines
216 B
Go
13 lines
216 B
Go
package utils
|
|
|
|
import "encoding/json"
|
|
|
|
func GetObjectHash(obj any) string {
|
|
data, _ := json.Marshal(obj)
|
|
if data == nil {
|
|
// random hash
|
|
return EncryptMd5(NewUUIDString())
|
|
}
|
|
return EncryptMd5(string(data))
|
|
}
|