Valentin Gosu aae60cff2b Use no-std instead of no_std in Cargo.toml (#1064) hace 1 año
..
src dbd526178e ran `cargo clippy --fix -- -Wclippy::use_self` (#1048) hace 1 año
tests e654efb9c1 Fix non-base64 data URLs with % character not followed by hex digits (#797) hace 2 años
Cargo.toml aae60cff2b Use no-std instead of no_std in Cargo.toml (#1064) hace 1 año
LICENSE-APACHE a6e63fed24 Add metadata for the data-url crate hace 8 años
LICENSE-MIT a6e63fed24 Add metadata for the data-url crate hace 8 años
README.md 9f6e92efe1 Add some some basic functions to `Mime` (#1047) hace 1 año

README.md

data-url

crates.io docs.rs

Processing of data: URLs in Rust according to the Fetch Standard: https://fetch.spec.whatwg.org/#data-urls but starting from a string rather than a parsed URL to avoid extra copies.

use data_url::{DataUrl, mime};

let url = DataUrl::process("data:,Hello%20World!").unwrap();
let (body, fragment) = url.decode_to_vec().unwrap();

assert!(url.mime_type().is("text", "plain"));
assert_eq!(url.mime_type().get_parameter("charset"), Some("US-ASCII"));
assert_eq!(body, b"Hello World!");
assert!(fragment.is_none());