#const #const-fn #algorithm

nightly cc4

Very simple implementation of the four_cc/fourcc algorithm as a const fn

3 releases

0.1.2 Jan 28, 2021
0.1.1 Jan 28, 2021
0.1.0 Jan 28, 2021

#1594 in Algorithms

MIT license

2KB

cc4

Implementation of four_cc in Rust as a const fn. Supports both little and big endian systems.

four_cc(b"code");

Since four_cc is a const fn, you can also use it to define enum values for enums represented by u32.

#[repr(u32)]
pub enum Id {
    Apple = four_cc(b"appl"),
}

No runtime deps