IsEncryptedSubscription reports whether s carries the RVSUB1 magic prefix.
(s string)
| 34 | |
| 35 | // IsEncryptedSubscription reports whether s carries the RVSUB1 magic prefix. |
| 36 | func IsEncryptedSubscription(s string) bool { |
| 37 | s = strings.TrimSpace(s) |
| 38 | s = strings.TrimPrefix(s, utf8BOM) |
| 39 | s = strings.TrimSpace(s) |
| 40 | return strings.HasPrefix(s, subscriptionMagic) |
| 41 | } |
| 42 | |
| 43 | // DecryptSubscription unwraps an RVSUB1-prefixed payload. For non-encrypted |
| 44 | // input it returns the trimmed value unchanged. |
no outgoing calls
no test coverage detected