This file contains hidden or 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" | |
"bytes" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" |
This file contains hidden or 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
// 获取转码使用耗时 | |
func getQn() { | |
fi, err := os.Open("/disk4/liangchao/202168_flv") | |
if err != nil { | |
fmt.Printf("Error: %s\n", err) | |
return | |
} | |
defer fi.Close() | |
br := bufio.NewReader(fi) |
This file contains hidden or 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
flag.IntVar(&base, "base", 0, "原始字符串的进制, 如果base为0,则会从字符串前置判断,”0x”是16进制,”0”是8进制,否则是10进制") | |
flag.StringVar(&parseStr, "parseStr", "", "待处理字符串") | |
flag.Parse() | |
v, err := strconv.ParseInt(parseStr, base, 64) | |
if err != nil { | |
log.Println(err) | |
} | |
fmt.Println(v) |
This file contains hidden or 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" | |
"bytes" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" |
This file contains hidden or 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" | |
"bytes" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" |
This file contains hidden or 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 ( | |
"encoding/json" | |
"fmt" | |
"github.com/qiniu/api.v7/auth" | |
"github.com/qiniu/api.v7/auth/qbox" | |
"io/ioutil" | |
"net/http" | |
"bytes" |
This file contains hidden or 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
public static void DownloadObject(string keyName) | |
{ | |
string[] keySplit = keyName.Split('/'); | |
string fileName = keySplit[keySplit.Length - 1]; | |
string dest = Path.Combine(HttpRuntime.CodegenDir, fileName); | |
using (client = Amazon.AWSClientFactory.CreateAmazonS3Client()) | |
{ | |
GetObjectRequest request = new GetObjectRequest().WithBucketName(bucketName).WithKey(keyName); | |
This file contains hidden or 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 qiniustg | |
import ( | |
"config" | |
"fmt" | |
"strings" | |
"strconv" | |
"github.com/qiniu/api.v7/auth/qbox" | |
"github.com/qiniu/api.v7/storage" | |
) |
This file contains hidden or 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 qiniustg | |
import ( | |
"config" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"encoding/json" | |
"strconv" | |
) |
This file contains hidden or 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
h := md5.New() | |
io.WriteString(h, "/D1/74/D174BCBDA755B66D8D4AB5FA7CB86BB0.f4v-1599580800-wVPJsMQQX97WQIlnpBIPpy27bSzK0bOr") | |
fmt.Printf("%x\n", h.Sum(nil)) |
NewerOlder