
# Symbolism

Unique symbols made from human readable tags.

[![Version](https://img.shields.io/static/v1?label=version&message=0.1.0&color=informational)](https://gitlab.com/konnorandrews/symbolism)
[![docs.rs](https://img.shields.io/docsrs/symbolism)](https://docs.rs/symbolism/latest/symbolism/)
[![Crates.io License](https://img.shields.io/crates/l/symbolism)](#license)
[![Crates.io](https://img.shields.io/crates/v/symbolism)](https://crates.io/crates/symbolism)

This crate uses [arithmetic coding](https://en.wikipedia.org/wiki/Arithmetic_coding) to
compress a string literal into a `u64` value. These compressed values are always unique per
input string.

The values can also be used in const generics. Which allows using strings
in types. The \[`s`\] macro provides a concise way to create symbols for these uses.

This crate was inspired by [`smol-symbol`](https://crates.io/crates/smol-symbol) which uses
a fixed width encoding and a `u128`.

### `no_std` Support

This crate is always `#![no_std]`, it can be used anywhere Rust can.

### Minimum Supported Rust Version

Requires Rust 1.71.0.

This crate follows the ["Latest stable Rust" policy](https://gist.github.com/alexheretic/d1e98d8433b602e57f5d0a9637927e0c). The listed MSRV won't be changed unless needed.
However, updating the MSRV anywhere up to the latest stable at time of release
is allowed.

## Contributing

Contributions in any form (issues, pull requests, etc.) to this project must adhere to 
Rust's [Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct).

Unless you explicitly state otherwise, any contribution intentionally submitted for 
inclusion in `symbolism` by you shall be licensed as below, without any 
additional terms or conditions.

## License

This project is licensed under either of

  * [Apache License 2.0](LICENSE-Apache-2.0)
  * [MIT License](LICENSE-MIT)

at your option.

