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

Function TestRawMethod_Encrypt

internal/encrypt/method_raw_test.go:5–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func TestRawMethod_Encrypt(t *testing.T) {
6 method, err := NewMethodInstance("raw", "abc", "123")
7 if err != nil {
8 t.Fatal(err)
9 }
10 src := []byte("Hello, World")
11 dst, err := method.Encrypt(src)
12 if err != nil {
13 t.Fatal(err)
14 }
15 dst = dst[:len(src)]
16 t.Log("dst:", string(dst))
17
18 src, err = method.Decrypt(dst)
19 if err != nil {
20 t.Fatal(err)
21 }
22 t.Log("src:", string(src))
23}

Callers

nothing calls this directly

Calls 4

NewMethodInstanceFunction · 0.85
LogMethod · 0.80
EncryptMethod · 0.65
DecryptMethod · 0.65

Tested by

no test coverage detected