coderpwh
0D
V2EX  ›  Rust

用 rust 写了文字隐藏水印库

  •  
  •   coderpwh · Jan 30, 2024 · 2031 views
    This topic created in 865 days ago, the information mentioned may be changed or developed.

    text_hidden

    使用 rust 实现了文字隐藏库,原理基于零宽字符,可用于微信,qq 等通用聊天或社交软件平台。

    Usage

    Cargo.toml

    cargo add text_hidden
    

    Example

    code

    fn main() {
        //加密方法
        let cipher = NoCipher;
        //文本水印摆放位置
        let pose = SimplePose::default();
        let text_hidden = TextHidden::new(cipher, pose, '\u{200B}', '\u{200C}');
        let th = text_hidden.text_hidden("hello", "key");
        println!("加密后:{}长度:{}!", th,th.len());
        let result = text_hidden.text_recover(th.as_str());
        let result_str = result.unwrap();
        println!("解密后:{}长度:{}", result_str, result_str.len());
    }
    

    效果图 img

    other

    项目地址text_hidden

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2904 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:06 · PVG 18:06 · LAX 03:06 · JFK 06:06
    ♥ Do have faith in what you're doing.