26 releases (6 breaking)

new 0.8.0 Jan 14, 2025
0.8.0-rc.4 Dec 30, 2024
0.3.1 Nov 9, 2024

#329 in Development tools

Download history 298/week @ 2024-11-07 22/week @ 2024-11-14 10/week @ 2024-11-21 1/week @ 2024-11-28 451/week @ 2024-12-05 854/week @ 2024-12-12 549/week @ 2024-12-19 989/week @ 2024-12-26 218/week @ 2025-01-02 98/week @ 2025-01-09

1,897 downloads per month
Used in 2 crates

GPL-3.0-only

165KB
3K SLoC

macro-toolset

Crates.io Version docs.rs GitHub Tag

Some useful macros, to make the repetitive code less.

Features

  • str_concat almost everything
  • Hashing and encode to HEX
    • MD5
    • SHA256
    • SHA384
    • SHA512
  • Macro for creating a wrapper struct.
  • ...

The features listed in Cargo.toml:

  • dev: For development and enable all features. Not recommended since introducing axum, etc will add many dependencies.
  • feat-base64: Base64 encode and decode related utilities.
  • feat-hash: Hash algorithms (MD5, SHA256, SHA384, SHA512) related utilities.
  • feat-random: Random number / string related utilities. You shall add rand to your Cargo.toml.
  • feat-random-fast: Random number / string related utilities. You shall add rand to your Cargo.toml.
  • feat-string: String related utilities.
    • feat-string-ext-ammonia: Serializes an ammonia::Document instance without allocation.
    • feat-string-ext-base64: wrapper that indicates the inner slice should be encoded in base64 over &[u8]
    • feat-string-ext-chrono: crate chrono integration.
    • feat-string-ext-hex: hex encoding based on const-hex, with better performance than NumStr.
    • feat-string-ext-http: crate http integration.
    • feat-string-ext-rand: random number / string support.
    • feat-string-ext-ryu: float number support.
    • feat-string-ext-urlencoding: urlencoding support.

MSRV

1.75.0

Notice

This crate is currently intended for personal use mostly, but contributions are welcome.

Migration from 0.7.X to 0.8.0

The most significant change is that StringExt is removed and just use std String with trait PushAnyT instead. If you just make use of str_concat macro, nothing needs to be changed, I think.

For more details please refer to the docs and examples.

LICENSE

GPL-3.0-only

Dependencies

~0–6.5MB
~27K SLoC