ntp-packet-parser
Version:
A parser for NTP UDP packets
26 lines (25 loc) • 789 B
TypeScript
import { NtpPacket } from "./NtpPacket";
export declare class NtpPacketParser {
/**
* Returns the structure of the UDP packet for parsing
*/
private static get packetStruct();
/**
* Returns the selected bits in binary notation
*/
private static _getBits;
/**
* Converts a NTP identifier from binary notation to ASCII
* @param {string} value Bits in binary notation
*/
private static _ntpIdentifier;
/**
* Converts a NTP timestamp from binary notation to a Date object
* @param {string} value Bits in binary notation
*/
static _fromNtpTimestamp(value: string): Date;
/**
* Parses an UDP packet buffer and returns a NtpPacket struct
*/
static parse(udpPacket: Buffer): Partial<NtpPacket>;
}