鑒于:arr := make([]byte, 8)fmt.Println(arr) // [0 0 0 0 0 0 0 0]big := new(big.Int).SetBytes(arr).Bytes()fmt.Println(big) // []我試著把數字 1 放進去,得到了這樣的結果:... // [0 0 0 0 0 0 0 1] from []byte...// [1] from big.Int我必須保留 8 的長度,但big.Int不允許這樣做。怎樣才能把它保存下來呢?
如何保留 big.Int.Bytes() len?
慕無忌1623718
2022-11-28 17:06:10