MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / encodeString

Method encodeString

cache/redis_cache.go:194–201  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

192 return nil
193}
194func (r *redisCache) encodeString(s string) []byte {
195 n := uint32(len(s))
196
197 b := make([]byte, 0, n+4)
198 b = append(b, byte(n>>24), byte(n>>16), byte(n>>8), byte(n))
199 b = append(b, s...)
200 return b
201}
202
203func (r *redisCache) decodeString(bytes []byte) (string, int, error) {
204 if len(bytes) < 4 {

Callers 2

encodeMetadataMethod · 0.95
TestStringFromToByteFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestStringFromToByteFunction · 0.64