package { import by.blooddy.crypto.Base64; import by.blooddy.crypto.serialization.JSON; import flash.display.Sprite; import flash.utils.ByteArray; public class JosnTest extends Sprite { public function JosnTest() { var obj:Object = {}; obj.w = 320; obj.h = 240; obj.url = "http://baidu.com"; var jsonStr:String = by.blooddy.crypto.serialization.JSON.encode(obj); trace(jsonStr); var bytes:ByteArray = new ByteArray(); bytes.writeUTFBytes(jsonStr); trace(Base64.encode(bytes)); var objStr:String = '{"expiredays":1,' + '"MONY_PK_USER_KEY_2236214199":{"value":true,"expiredays":0,"writeDate":1533722058677},' + '"50016574_task10_fin_date":{"value":"2018/08/08 3","expiredays":1,"writeDate":1533695837228},' + '"1522326439_task7_fin_date":{"value":true,"expiredays":0,"writeDate":1533696143119},' + '"history_enter_channel_report_key3_2236214199":{"value":true,"expiredays":360,"writeDate":1533711759553},' + '"history_enter_channel_report_2_key3_2236214199":{"value":1533711759561,"expiredays":360,"writeDate":1533711759563},' + '"GIFT_GUID_PER_DAY":{"value":true,"expiredays":1,"writeDate":1533696623063},' + '"writeDate":1533605935114,' + '"1522326439_task8_fin_date":{"value":"2018/08/08 3","expiredays":1,"writeDate":1533695401165},' + '"2236214199_task10_fin_date":{"value":"2018/08/08 3","expiredays":1,"writeDate":1533712412043},' + '"vippkgame_160415_2236214199":{"value":true,"expiredays":10,"writeDate":1533711763054},' + '"1522326439_task10_fin_date":{"value":"2018/08/08 3","expiredays":1,"writeDate":1533697198412},' + '"vippkgame_160415_50016574":{"value":true,"expiredays":10,"writeDate":1533709579401},' + '"history_enter_channel_report_key3_1522326439":{"value":true,"expiredays":360,"writeDate":1533695535546},' + '"ANCHOR_TAG_NAME_2018/08/08 3_2236214199":{"value":true,"expiredays":360,"writeDate":1533711796587},' + '"MONY_PK_USER_KEY_1522326439":{"value":true,"expiredays":0,"writeDate":1533711636358},' + '"2236214199_task7_fin_date":{"value":true,"expiredays":0,"writeDate":1533711845214},' + '"history_enter_channel_report_key3_50016574":{"value":true,"expiredays":360,"writeDate":1533709575802},' + '"history_enter_channel_report_2_key3_50016574":{"value":1533709575810,"expiredays":360,"writeDate":1533709575811},' + '"ANCHOR_TAG_NAME_2018/08/08 3_1522326439":{"value":true,"expiredays":360,"writeDate":1533696896350},' + '"history_enter_channel_report_2_key3_1522326439":{"value":1533695535554,"expiredays":360,"writeDate":1533695535555},' + '"50016574_task7_fin_date":{"value":true,"expiredays":0,"writeDate":1533709596859},' + '"1522326439_task9_fin_date":{"value":"2018/08/08 3","expiredays":1,"writeDate":1533695401411},' + '"2236214199_task9_fin_date":{"value":"2018/08/08 3","expiredays":1,"writeDate":1533711767245},' + '"ANCHOR_TAG_NAME_2018/08/08 3_50016574":{"value":true,"expiredays":360,"writeDate":1533709596359},' + '"2236214199_task8_fin_date":{"value":"2018/08/08 3","expiredays":1,"writeDate":1533711766993},' + '"value":"2018/08/07 2"}' by.blooddy.crypto.serialization.JSON.decode(objStr); } } }