From 1df7400ad59f3703f179759c8c2dc2490c4ee954 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 18 Nov 2021 23:01:35 +0530 Subject: [PATCH] And an example serialization --- docs/file-transfer-protocol.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/file-transfer-protocol.rst b/docs/file-transfer-protocol.rst index 032f07c14..4ac699eb0 100644 --- a/docs/file-transfer-protocol.rst +++ b/docs/file-transfer-protocol.rst @@ -282,3 +282,16 @@ base64_string base64_bytes Binary data encoded using the standard base64 encoding + + +An example of serializing an escape code is shown below:: + + action=send id=test name=somefile size=3 data=01 02 03 + +becomes:: + + 5113 ; ac=send ; id=test ; n=c29tZWZpbGU= ; sz=3 ; d=AQID + +Here ``c29tZWZpbGU`` is the base64 encoded form of somefile and ``AQID`` is the +base64 encoded form of the bytes ``0x01 0x02 0x03``. The spaces in the encoded +form are present for clarity and should be ignored.