MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / Search

Method Search

tools/owl/scan/matcher.go:54–70  ·  view source on GitHub ↗

Search match search signatures by md5 in file collections

(files []string, searchTerm string)

Source from the content-addressed store, hash-verified

52
53// Search match search signatures by md5 in file collections
54func (*Md5Matcher) Search(files []string, searchTerm string) ([]*Result, error) {
55 res := make([]*Result, 0)
56 for i, v := range files {
57 if md5, err := Md5(v); err != nil {
58 return nil, err
59 } else {
60 if md5 == searchTerm {
61 res = append(res, &Result{
62 Index: i + 1,
63 Path: v,
64 Code: md5,
65 })
66 }
67 }
68 }
69 return res, nil
70}
71
72// Search match search signatures by hex in file collections
73func (*HexMatcher) Search(files []string, searchTerm string) ([]*Result, error) {

Callers

nothing calls this directly

Calls 1

Md5Function · 0.85

Tested by

no test coverage detected