jsurl

Crates.iojsurl
lib.rsjsurl
version0.1.0
sourcesrc
created_at2024-02-27 02:41:24.572804
updated_at2024-02-27 02:41:24.572804
descriptionA more compact and human-readable alternative to JSON + URL encoding.
homepagehttps://github.com/Chriscbr/jsurl-rs
repositoryhttps://github.com/Chriscbr/jsurl-rs
max_upload_size
id1154424
size35,322
Chris Rybicki (Chriscbr)

documentation

https://docs.rs/jsurl/

README

jsurl

A more compact and human-readable alternative to JSON + URL encoding.

crates.io Documentation Rust CI rustc 1.0+

Dependency Status Download Status

Usage

Add this to your Cargo.toml:

[dependencies]
jsurl = "0.1"

Description

This crate is a Rust implementation of the jsurl serialization format. It is a more compact and human-readable alternative to plain URL encoding for including JSON in URLs.

Example

use jsurl::{deserialize, serialize};
use serde_json::json;

let obj = json!({
    "name": "John Doe",
    "age": 42,
    "children": ["Mary", "Bill"]
});

let serialized = serialize(&obj);
assert_eq!(serialized, "~(name~'John*20Doe~age~42~children~(~'Mary~'Bill))");

let deserialized = deserialize("~(name~'John*20Doe~age~42~children~(~'Mary~'Bill))").unwrap();
assert_eq!(deserialized, obj);

License

Dual-licensed for compatibility with the Rust project.

Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0, or the MIT license: http://opensource.org/licenses/MIT, at your option.

Commit count: 0

cargo fmt