Crates.io | escape-ascii |
lib.rs | escape-ascii |
version | 0.1.0 |
source | src |
created_at | 2023-06-30 09:07:51.286809 |
updated_at | 2023-06-30 09:07:51.286809 |
description | An extremly tiny tool to convert stdin raw byte stream to printable escaped-ascii form (with slice::escape_ascii()), such as byte literals in source codes on many programming languages (e.g. "\x1b\x04printable\x16\n") |
homepage | |
repository | https://github.com/snoopy3476/escape-ascii.git |
max_upload_size | |
id | 904292 |
size | 10,461 |
An extremely tiny tool to convert stdin raw byte stream to printable escaped-ascii form, such as byte literals in source codes on many programming languages (e.g. "\x1b\x04printable\x16\n"
).
This tool just help calling the rust function slice::escape_ascii directly from command line.
For more information about how this tool converts, check the rust official documentations of std::ascii::escape_default.
$ cargo install escape-ascii
$ BYTES="$(cat /dev/urandom | head -c10)"
$ printf "%s" "$BYTES"; echo
��f�YڵH
$ printf "%s" "$BYTES" | escape-ascii; echo
\x8a\x8bf\xa1\x8f\x08Y\xda\xb5H
Kim Hwiwon <kim.hwiwon@outlook.com>
The MIT License (MIT)