MCPcopy
hub / github.com/getsops/sops / reverse

Function reverse

sops_test.go:20–26  ·  view source on GitHub ↗

reverse returns its argument string reversed rune-wise left to right.

(s string)

Source from the content-addressed store, hash-verified

18
19// reverse returns its argument string reversed rune-wise left to right.
20func reverse(s string) string {
21 r := []rune(s)
22 for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
23 r[i], r[j] = r[j], r[i]
24 }
25 return string(r)
26}
27
28func (c reverseCipher) Encrypt(value interface{}, key []byte, path string) (string, error) {
29 b, err := ToBytes(value)

Callers 2

EncryptMethod · 0.85
DecryptMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected