代码拉取完成,页面将自动刷新
// Thanks to https://github.com/buschtoens/sni
module.exports = data => {
let end = data.length
let pointer = 5 + 1 + 3 + 2 + 32
const nan = (number = pointer) => isNaN(number)
if(pointer + 1 > end || nan()) return null
pointer += 1 + data[pointer]
if(pointer + 2 > end || nan()) return null
pointer += 2 + data.readInt16BE(pointer)
if(pointer + 1 > end || nan()) return null
pointer += 1 + data[pointer]
if(pointer + 2 > end || nan()) return null
let extensionsLength = data.readInt16BE(pointer)
pointer += 2
let extensionsEnd = pointer + extensionsLength
if(extensionsEnd > end || nan(extensionsEnd)) return null
end = extensionsEnd
while(pointer + 4 <= end || nan()){
let extensionType = data.readInt16BE(pointer)
let extensionSize = data.readInt16BE(pointer + 2)
pointer += 4
if(extensionType !== 0){
pointer += extensionSize
continue
}
if(pointer + 2 > end || nan()) return null
let nameListLength = data.readInt16BE(pointer)
pointer += 2
if(pointer + nameListLength > end) return null
while(pointer + 3 <= end || nan()){
let nameType = data[pointer]
let nameLength = data.readInt16BE(pointer + 1)
pointer += 3
if(nameType !== 0){
pointer += nameLength
continue
}
if(pointer + nameLength > end || nan()) return null
return data.toString('ascii', pointer, pointer + nameLength)
}
}
return null
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。