update to new go-steam version

This commit is contained in:
2025-10-26 05:20:47 +01:00
parent ab8b0b983c
commit df22705679
8 changed files with 364 additions and 312 deletions

View File

@@ -2,6 +2,7 @@ package csgo
import (
"encoding/binary"
"errors"
"fmt"
"math/big"
"regexp"
@@ -29,10 +30,10 @@ func DecodeSharecode(code string) (matchID, outcomeID uint64, tokenID uint16, er
bigInt.Add(bigInt, big.NewInt(int64(strings.Index(Base57Chars, c))))
}
if bigInt.BitLen() > 144 { //nolint:gomnd
return 0, 0, 0, fmt.Errorf("invalid sharecode")
if bigInt.BitLen() > 144 {
return 0, 0, 0, errors.New("invalid sharecode")
}
bytes := make([]byte, 18) //nolint:gomnd
bytes := make([]byte, 18)
bigInt.FillBytes(bytes)
matchID = binary.LittleEndian.Uint64(bytes[0:8])