#plant-uml #diagram #url-safe #string #image-url #text

rusty_plantuml_encoder

A package for encoding and compressing text for plantuml diagram

3 releases

0.0.3 Aug 8, 2024
0.0.2 Aug 8, 2024
0.0.1 Aug 8, 2024

#254 in Compression

Download history 245/week @ 2024-08-05 25/week @ 2024-08-12 40/week @ 2024-09-16 18/week @ 2024-09-23 51/week @ 2024-09-30

109 downloads per month

MIT license

4KB
62 lines

PlantUML Encoder

A Rust library for encoding PlantUML diagram code, generating compressed strings for use in PlantUML image URLs.

Installation

Add this to your Cargo.toml:

[dependencies]
plantuml_encoder = "0.0.3"

Usage

use rusty_plantuml_encoder::encodep;

fn main() {
    let diagram = "@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
@enduml";

    let encoded = encodep(diagram);
    println!("Encoded URL: http://www.plantuml.com/plantuml/img/{}", encoded);
}

Features

  • UTF-8 encoding
  • DEFLATE compression
  • Custom 64-character encoding for URL-safe strings

Note

This encoder is specifically designed for PlantUML diagrams and may not be suitable for general-purpose encoding or encryption.

Dependencies

~3.5MB
~124K SLoC