13 lines
433 B
JavaScript
13 lines
433 B
JavaScript
/**
|
|
* CoT stream first-byte detection: TAK Protocol (0xBF) or traditional XML (0x3C '<').
|
|
* Used by tests and any code that must distinguish CoT from other protocols.
|
|
*/
|
|
|
|
export const COT_FIRST_BYTE_TAK = 0xBF
|
|
export const COT_FIRST_BYTE_XML = 0x3C
|
|
|
|
/** @param {number} byte - First byte of stream. @returns {boolean} */
|
|
export function isCotFirstByte(byte) {
|
|
return byte === COT_FIRST_BYTE_TAK || byte === COT_FIRST_BYTE_XML
|
|
}
|