1
0

style(p4, p9): fix style issue

This commit is contained in:
2025-09-02 12:05:26 +08:00
parent dd3d486094
commit 27e7137418
2 changed files with 5 additions and 4 deletions

View File

@@ -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}");
}
}
// 尝试将字节转换为字符串