chunksize 계산
This commit is contained in:
@ -1,9 +1,27 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDownload(t *testing.T) {
|
||||
download(".", "https://kdcc.action2quare.com/houston/_deploys/game/0.18.186.1/game.zip", "", nil)
|
||||
func pof2(x int64) (out int64) {
|
||||
out = 1
|
||||
org := x
|
||||
for (x >> 1) > 0 {
|
||||
out = out << 1
|
||||
x = x >> 1
|
||||
}
|
||||
if org > out {
|
||||
out = out << 1
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func TestDownload(t *testing.T) {
|
||||
//download(".", "https://kdcc.action2quare.com/houston/_deploys/game/0.18.186.1/game.zip", "", nil)
|
||||
fmt.Println(pof2(1023))
|
||||
fmt.Println(pof2(1024))
|
||||
fmt.Println(pof2(1025))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user