style(p4, p9): fix style issue
This commit is contained in:
@@ -13,10 +13,10 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
// 对密文的每个字节应用异或操作,得到明文
|
||||
let plaintext: Vec<u8> = cipher_bytes.iter().map(|&byte| byte ^ key).collect();
|
||||
for i in 0..=(plaintext.iter().len() - window_size) {
|
||||
if let Ok(text) = std::str::from_utf8(&plaintext[i..i + window_size]) {
|
||||
if is_valid_english(text, None) {
|
||||
println!("Found valid sentence with key {key}: {text}");
|
||||
}
|
||||
if let Ok(text) = std::str::from_utf8(&plaintext[i..i + window_size])
|
||||
&& is_valid_english(text, None)
|
||||
{
|
||||
println!("Found valid sentence with key {key}: {text}");
|
||||
}
|
||||
}
|
||||
// 尝试将字节转换为字符串
|
||||
|
||||
Reference in New Issue
Block a user