mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-04 05:26:51 -04:00
19 lines
244 B
Go
19 lines
244 B
Go
package common
|
|
|
|
import (
|
|
"encoding/binary"
|
|
)
|
|
|
|
func Integer(number []byte) int {
|
|
num_len := len(number)
|
|
if num_len < 8 {
|
|
number = append(
|
|
make([]byte, 8-num_len),
|
|
number...,
|
|
)
|
|
}
|
|
return int(
|
|
binary.BigEndian.Uint64(number),
|
|
)
|
|
}
|