reverse returns its argument string reversed rune-wise left to right.
(s string)
| 18 | |
| 19 | // reverse returns its argument string reversed rune-wise left to right. |
| 20 | func 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 | |
| 28 | func (c reverseCipher) Encrypt(value interface{}, key []byte, path string) (string, error) { |
| 29 | b, err := ToBytes(value) |