MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / EncodeSourceLinkID

Function EncodeSourceLinkID

pkg/hashid/hash.go:145–148  ·  view source on GitHub ↗

EncodeSourceLinkID encode source link id to hash id

(encoder Encoder, id int)

Source from the content-addressed store, hash-verified

143
144// EncodeSourceLinkID encode source link id to hash id
145func EncodeSourceLinkID(encoder Encoder, id int) string {
146 res, _ := encoder.Encode([]int{id, SourceLinkID})
147 return res
148}
149
150func FromContext(c context.Context) int {
151 return c.Value(ObjectIDCtx{}).(int)

Callers 3

BuildDirectLinkFunction · 0.92
GetMethod · 0.92
GetDirectLinkMethod · 0.92

Calls 1

EncodeMethod · 0.65

Tested by

no test coverage detected