mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-08-31 11:59:16 +00:00
22 lines
553 B
TypeScript
22 lines
553 B
TypeScript
import type {
|
|
DataTrackerTimestampChunk,
|
|
DataTrackerTimestampChunkData,
|
|
} from '../../models/data/data-tracker-timestamp-chunk.js';
|
|
import { Decoders } from '../index.js';
|
|
|
|
export default (buffer: Uint8Array): DataTrackerTimestampChunk => {
|
|
const chunk = Decoders.Chunk(buffer);
|
|
|
|
const view = new DataView(chunk.chunkData.buffer, chunk.chunkData.byteOffset, chunk.chunkData.byteLength);
|
|
const timestamp = view.getBigUint64(0, true);
|
|
|
|
const data: DataTrackerTimestampChunkData = {
|
|
timestamp,
|
|
};
|
|
|
|
return {
|
|
chunk,
|
|
data,
|
|
};
|
|
};
|