str_to_bytes

Crates.iostr_to_bytes
lib.rsstr_to_bytes
version0.2.3
sourcesrc
created_at2022-10-21 05:25:09.94984
updated_at2022-11-14 12:25:09.219583
descriptionparse a string representations of numbers or ascii text and return a Vec
homepage
repositoryhttps://github.com/Yohannfra/str_to_bytes
max_upload_size
id693197
size16,753
Yohann (Yohannfra)

documentation

README

str_to_bytes

A library to parse a string representations of numbers or ascii text and return a Vec<u8>.

This library was originally created to be used in bluerepl

Examples

"0xff 0xfa 0b11" => [0xff, 0xfa, 0b11]
"0b01 ASCII(abc) 12 44 0x35" => [0b01, 97, 98, 99, 12, 44, 0x35]
...

Formats

  • 0b... or 0B... -> Binary number
  • 0x... or 0X... -> Hexadecimal number
  • 123 -> decimal number
  • ASCII(...) -> Ascii text

License

This library is licensed under the terms of the MIT license.

Commit count: 12

cargo fmt