const e=require("compact-encoding"),n={preencode(n,t){e.uint.preencode(n,t.version),e.uint.preencode(n,t.timestamp)},encode(n,t){e.uint.encode(n,t.version),e.uint.encode(n,t.timestamp)},decode:n=>({version:e.uint.decode(n),timestamp:e.uint.decode(n)})};module.exports={encodeHandshake:function(t){return e.encode(n,{version:1,timestamp:t})},decodeHandshake:function(t){try{const o=e.decode(n,t);return 0===o.timestamp?null:o}catch{return null}}};