Implement data encode/decode in order to pass the GFW.

Signed-off-by: vulcan.lin <ssjmhyvi@gmail.com>