I2P string format

This commit is contained in:
Hayden Parker
2016-02-04 00:54:51 -08:00
parent 7e32bd2458
commit e6cc4425c6
11 changed files with 76 additions and 17 deletions

View File

@ -4,7 +4,14 @@ import (
"encoding/binary"
)
func Integer(number ...byte) int {
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),
)