公告板
版本库
filestore
活动
搜索
登录
aps
/
plc-recorder
plc-recorder
概况
操作记录
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
web 接口添加token
zhangzengfei
2023-08-11
a335f66c4c520728be640ca4e7029ce6f45b8f3d
[aps/plc-recorder.git]
/
util
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package util
import (
"bytes"
"encoding/binary"
)
func IntToBytes(n int) []byte {
x := int32(n)
bytesBuffer := bytes.NewBuffer([]byte{})
binary.Write(bytesBuffer, binary.LittleEndian, x)
return bytesBuffer.Bytes()
}