#zalgo #unicode #obfuscation #proc-macro #compilation #compile-time

macro zalgo-codec-macro

Provides the zalgo_embed! macro for compiling source code that's been converted into a single grapheme cluster by the zalgo-codec-common crate

33 releases

new 0.1.32 Nov 23, 2024
0.1.30 Oct 2, 2024
0.1.28 Jun 29, 2024
0.1.25 Jan 14, 2024
0.1.2 Nov 20, 2022

#33 in #obfuscation

Download history 32/week @ 2024-08-03 2/week @ 2024-08-10 9/week @ 2024-08-24 4/week @ 2024-08-31 140/week @ 2024-09-07 110/week @ 2024-09-14 77/week @ 2024-09-21 216/week @ 2024-09-28 28/week @ 2024-10-05 3/week @ 2024-10-12 68/week @ 2024-11-09 51/week @ 2024-11-16

119 downloads per month
Used in zalgo-codec

MIT/Apache

89KB
995 lines

zalgo-codec-macro

This crate provides the macro part of the crate zalgo-codec by defining the procedural macros zalgo_embed! and zalgofy!.

The first lets you take source code that's been converted into a single grapheme cluster by the zalgo-codec-common crate and compile it as if it was never zalgo-ified.
This lets you reach new lows in the field of self-documenting code.

The second lets you encode a string into a single grapheme cluster at compile time.

Example

If we run zalgo-codec-common::zalgo_encode on the string "fn square(x: i32) -> i32 {x * x}" we can include the square function in our program by putting the resulting grapheme cluster inside zalgo_embed!:

zalgo_embed!("E͎͓͕͉̞͉͆̀͑́͒̈̀̓̒̉̀̍̀̓̒̀͛̀̊̀͘̚͘͘͝ͅ");
assert_eq!(square(10), 100);

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~250–700KB
~17K SLoC