| Crates.io | stegano-util |
| lib.rs | stegano-util |
| version | 0.1.0 |
| created_at | 2025-09-15 08:33:14.3086+00 |
| updated_at | 2025-09-15 08:33:14.3086+00 |
| description | A tool for steganographically embedding files into images. |
| homepage | |
| repository | https://github.com/hbesljx/stegano-util.git |
| max_upload_size | |
| id | 1839631 |
| size | 38,822 |
luma_lsb_hide:基于YCbCr中的Luma向量的lsb隐写示例:
use stegano_util::luma_lsb_hide;
use stegano_util::luma_lsb_read;
#[test]
fn test_luma_lsb_hide(){
let img_path:&str="./tests/input.jpg";
let less_bin_path:&str="./tests/less.bin";
let more_bin_path:&str="./tests/more.bin";
let res1=luma_lsb_hide(img_path, less_bin_path);
match res1 {
Ok(_)=>{println!("隐写成功!");},
Err(err)=>{println!("{}",&err);}
}
let res2=luma_lsb_hide(img_path, more_bin_path);
match res2 {
Ok(_)=>{println!("隐写成功!");},
Err(err)=>{println!("{}",&err);}
}
}
#[test]
fn test_luma_lsb_read(){
let output_path="./output.png";
let res3=luma_lsb_read(output_path);
match res3 {
Ok(value)=>{println!("{:?}",value.iter().map(|b| format!("{:02x}", b)).collect::<String>());},
Err(err)=>{
println!("{}",err);
return;
}
}
}