MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / init

Function init

internal/utils/encrypt.go:28–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26var encryptV2Suffix = []byte("$v2")
27
28func init() {
29 if !teaconst.IsMain {
30 return
31 }
32
33 events.On(events.EventReload, func() {
34 nodeConfig, _ := nodeconfigs.SharedNodeConfig()
35 if nodeConfig != nil {
36 defaultNodeEncryptKey = stringutil.Md5(nodeConfig.NodeId + "@" + nodeConfig.Secret)
37 if len(nodeConfig.ClusterSecret) == 0 {
38 defaultClusterEncryptKey = defaultNodeEncryptKey
39 } else {
40 defaultClusterEncryptKey = stringutil.Md5(nodeConfig.ClusterSecret)
41 }
42 }
43 })
44}
45
46// SimpleEncrypt 加密特殊信息
47func SimpleEncrypt(data []byte) []byte {

Callers

nothing calls this directly

Calls 1

OnFunction · 0.92

Tested by

no test coverage detected