Skip to main content

hide_decrypt

Function hide_decrypt 

Source
pub fn hide_decrypt<T>(info: T) -> Result<String, HideSomethingError>
where T: ToString,
Expand description

Recovers the original information from a hidden text produced by hide_encrypt.

§Process

  1. Extract bits from the case of all alphabetic characters (uppercase = 1, lowercase = 0).
  2. Group bits into bytes (MSB first) and discard any trailing partial byte.
  3. Read the first 4 bytes as a big‑endian length.
  4. Extract the compressed payload of that length and decompress it.
  5. Convert the decompressed bytes back into a UTF‑8 string.

§Errors

Returns HideSomethingError if the extracted data is too short, if decompression fails, or if the decoded bytes are not valid UTF‑8.

§Example

use hide_something::hide_decrypt;
let hidden = "HeLlO WoRlD!"; // actually hides something else
// In practice you would use hide_encrypt to produce the hidden text.