Crate planturl

source ·
Expand description

planturl

Helper-crate to convert plantuml-sourcecode to a url-string accepted by the PlantUML-Demo-Server.

use planturl::{encode,cleanup_input};
let input = "Bob -> Alice : hello";
assert_eq!("SyfFKj2rKt3CoKnELR1Io4ZDoSa70000",
   encode(&deflate::deflate_bytes_conf(
         cleanup_input(input).as_bytes(),
         deflate::Compression::Best
        ))
);

Functions

Trims the input-data by removing the @startuml-prelude and @enduml-suffix. Needed to reduce size of URL.
Encodes the 8-bit array in a 6-bit-based String analog to base64. Described in Plantuml-Documentation.