This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QString str=UrlSafeBase64Encode(sha1Data); | |
std::cout<<str.toLocal8Bit().data()<<std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha1" | |
"crypto/x509" | |
"encoding/base64" | |
"encoding/pem" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Security.Cryptography.X509Certificates; | |
namespace Qiniu.Util | |
{ | |
public static class Base64URLSafe | |
{ | |
public static string Encode (string text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha1" | |
"crypto/x509" | |
"encoding/base64" | |
"encoding/pem" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#回调验签代码 | |
__author__ = 'jemy' | |
from qiniu.auth import digest | |
import urllib | |
path = '/~jemy/qiniu-lab-php/demos/service/callback_upload_service.php' | |
body = 'fname=jemygraw_999.png&etag=FkbO_BZF_49z0j63-2i1C25QGdT3&key=FkbO_BZF_49z0j63-2i1C25QGdT3&exParam1=w&exParam2=h&exParam3=h' | |
access_key = 'pObK-5uirmOAtYGM705oxIco1m9xlqwONnYyLOoX' | |
secret_key = 'wXIqwPbClstEew5vibPkUJPv-bJojiVe4aapNmYW' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function replace_unicode_escape_sequence($match) { | |
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
} | |
function unicode_decode($str) { | |
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str); | |
} | |
$data="fname=jemygraw_999.png\u0026etag=FkbO_BZF_49z0j63-2i1C25QGdT3\u0026key=FkbO_BZF_49z0j63-2i1C25QGdT3\u0026exParam1=w\u0026exParam2=h\u0026exParam3=h"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gecho -e "curl\tqboxrsctl" | |
#set variables | |
uploadFile="/Users/jemy/Documents/qiniu.png" | |
uploadHost="up.qiniu.com" | |
uploadToken="ELUs327kxVPJrGCXqWae9yioc0xYZyrIpbM6Wh6o:YEZCdEInhP2a-4Whb_D23nPl6b4=:eyJzY29wZSI6ImlmLXBibCIsImRlYWRsaW5lIjoxNDIyMDkxOTk3fQ==" | |
uploadBucket="if-pbl" | |
uploadTimes=1000 | |
curlPrefix="curl_1277431" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e "curl\tqboxrsctl" | |
#set variables | |
uploadFile="/home/jemy/Documents/qiniu.png" | |
uploadHost="upload.qiniu.com" | |
uploadToken="ELUs327kxVPJrGCXqWae9yioc0xYZyrIpbM6Wh6o:YEZCdEInhP2a-4Whb_D23nPl6b4=:eyJzY29wZSI6ImlmLXBibCIsImRlYWRsaW5lIjoxNDIyMDkxOTk3fQ==" | |
uploadBucket="if-pbl" | |
uploadTimes=1000 | |
curlPrefix="curl_pic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
//Usage: vsina http://video.weibo.com/show?fid=1034:0e906d53094c5d231bf09028af8ba9b1 | |
import ( | |
"bufio" | |
"fmt" | |
"github.com/astaxie/beego/httplib" | |
"io" | |
"io/ioutil" | |
"net/url" |
OlderNewer