encodeToString
fun <T> encodeToString(json: Json, principal: IhawuPrincipal?, serializer: SerializationStrategy<T>, value: T): String
Encodes value with serializer (a maskingSerializer) for principal, masking as it writes. The per-call context is installed for the duration of this synchronous encode and cleared after, so it never bleeds across calls; a null principal fails closed and the resource serializes as {}. For coroutine callers (e.g. Ktor, #82) use maskingContextElement(principal) on the JVM instead of this helper.