rusty_plantuml_encoder

Crates.iorusty_plantuml_encoder
lib.rsrusty_plantuml_encoder
version0.0.3
sourcesrc
created_at2024-08-08 22:38:07.97517
updated_at2024-08-08 22:46:54.044178
descriptionA package for encoding and compressing text for plantuml diagram
homepage
repositoryhttps://github.com/ansonhkg/rusty_plantuml_encoder
max_upload_size
id1330011
size3,972
Anson (Ansonhkg)

documentation

README

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.

Commit count: 0

cargo fmt