MCPcopy Create free account
hub / github.com/maxmcd/webtty / Encode

Function Encode

pkg/sd/session_description.go:18–26  ·  view source on GitHub ↗
(offer SessionDescription)

Source from the content-addressed store, hash-verified

16)
17
18func Encode(offer SessionDescription) string {
19 var b bytes.Buffer
20 w := zlib.NewWriter(&b)
21 w.Write([]byte(offer.Sdp))
22 w.Close()
23 offer.Sdp = base58.Encode(b.Bytes())
24 offerBytes, _ := json.Marshal(offer)
25 return base58.Encode(offerBytes)
26}
27
28func Decode(offer string) (sd SessionDescription, err error) {
29 decodeBytes := base58.Decode(offer)

Callers 5

runMethod · 0.92
runMethod · 0.92
encodeFunction · 0.92
TestEncodeDecodeFunction · 0.85
TestEncryptAndDecryptFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestEncodeDecodeFunction · 0.68
TestEncryptAndDecryptFunction · 0.68