1 Star 1 Fork 0

妙音 / oils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bytes.go 381 Bytes
一键复制 编辑 原始数据 按行查看 历史
妙音 提交于 2022-03-13 16:21 . style: lint
package u32
import "encoding/binary"
// Bytes uint32 to []byte.
func Bytes(i uint32) []byte {
four := 4
bytes := make([]byte, four)
binary.BigEndian.PutUint32(bytes, i)
return bytes
}
// Uint32 []byte to Uint32.
func Uint32(bytes []byte) uint32 {
return binary.BigEndian.Uint32(bytes)
}
// Bytes 转换字节码.
func (u U32) Bytes() []byte {
return Bytes(uint32(u))
}
1
https://gitee.com/xuender/oils.git
git@gitee.com:xuender/oils.git
xuender
oils
oils
v1.1.23

搜索帮助

53164aa7 5694891 3bd8fe86 5694891