Wesley13 Wesley13
2年前
java 实现PHP gzcompress 功能
为了直观加了base64 PHP代码:<?php$agzcompress("abc");echobase64_encode($a);//输出:eJxLTEoGAAJNASc解码:gzuncompress();源码提示默认使用的是zlib的 deflate进行编码的;
Wesley13 Wesley13
2年前
Go 使用 JSON
Encode将一个对象编码成JSON数据,接受一个interface{}对象,返回\\byte和errfuncMarshal(vinterface{}){byte,err}Marshal函数将会递归遍历整个对象,依次按照成员类型对这个对象进行编码,类型转换如下:1bool类型转换成JSON
Wesley13 Wesley13
2年前
md5加密
1importhashlib2importmd5在python2里边用这个34s'1234567'5print(s.encode())字符串转成bytes6mhashlib.md5(s.encode())加密7resm.
Stella981 Stella981
2年前
Android中的URL编码
您如何在Android中编码URL(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fsk.sofbug.com%2Fquestion%2FDmr5)?我以为是这样的:finalStringencodedURLURLEncoder.encode(urlAsStr
Stella981 Stella981
2年前
Python 编码encode()、 解码decode()问题
乱码这种东西,时不时出现。本来开开心心想着我要学习啦,然后兴高采烈打开了比火星文还火星文的字符……!(https://img2018.cnblogs.com/blog/1465325/201906/146532520190609173938579799690621.jpg)没事,我可以搞定这堆鬼画符。!(https://img2018.c
Stella981 Stella981
2年前
JSON 转lua table php版
functiondata2lua($data){$datajson_encode($data,JSON_UNESCAPED_UNICODE);$listsmbStrSplit($data);$lengthcount(
Wesley13 Wesley13
2年前
JSON函数
string json_encode ( mixed $value , int $options  0 , int $depth  512  )//arrays are returned only if you don't define index.mixed json_decode ( stri
Stella981 Stella981
2年前
535. Encode and Decode TinyURL
Question535\.EncodeandDecodeTinyURL(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fleetcode.com%2Fproblems%2Fencodeanddecodetinyurl%2Fdescription%2F)
Wesley13 Wesley13
2年前
PHP输出JSON,如何把空数组输出为对象
PHP输出JSON数据是非常方便的。一般情况下,PHP的一维数组输出为JSON时,会转成一个对象,也就是下面的形式:<?php$array'name''crazymus','age'18;echojson_encode($array