mirror of
https://github.com/jwetzell/psn-go.git
synced 2026-08-17 05:13:36 +00:00
31 lines
520 B
Go
31 lines
520 B
Go
package decoders
|
|
|
|
import (
|
|
"encoding/binary"
|
|
)
|
|
|
|
type DataTrackerTimestampChunkData struct {
|
|
Timestamp uint64
|
|
}
|
|
|
|
type DataTrackerTimestampChunk struct {
|
|
Chunk Chunk
|
|
Data DataTrackerTimestampChunkData
|
|
}
|
|
|
|
func DecodeDataTrackerTimestampChunk(bytes []byte) DataTrackerTimestampChunk {
|
|
chunk := DecodeChunk(bytes)
|
|
|
|
timestamp := binary.LittleEndian.Uint64(chunk.ChunkData[0:8])
|
|
|
|
data := DataTrackerTimestampChunkData{
|
|
Timestamp: timestamp,
|
|
}
|
|
|
|
return DataTrackerTimestampChunk{
|
|
Chunk: chunk,
|
|
Data: data,
|
|
}
|
|
|
|
}
|