diff --git a/Cargo.toml b/Cargo.toml index 58e8f61..1978fd5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "const-crc32" -version = "1.3.0" +name = "const-crc32-nostd" +version = "1.3.1" edition = "2021" authors = ["Jonathan Strong "] license = "MIT" description = "A `const fn` implementation of crc32 checksum algorithm" repository = "https://git.shipyard.rs/jstrong/const-crc32" -keywords = ["checksum", "crc", "crc32", "const"] +keywords = ["checksum", "crc", "crc32", "const", "no_std"] readme = "README.md" [dev-dependencies] diff --git a/src/lib.rs b/src/lib.rs index 503b7a6..184cf81 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,10 +3,12 @@ //! # Examples //! //! ``` +//! use const_crc32_nostd as const_crc32; //! const BYTES: &[u8] = "The quick brown fox jumps over the lazy dog".as_bytes(); //! const CKSUM: u32 = const_crc32::crc32(BYTES); //! assert_eq!(CKSUM, 0x414fa339_u32); //! ``` +#![no_std] /// used to generate up a [u32; 256] lookup table in `crc32`. this computes /// the table on demand for a given "index" `i` @@ -57,6 +59,8 @@ pub const fn crc32(buf: &[u8]) -> u32 { /// Calculating the checksum from several parts of a larger input: /// /// ``` +/// use const_crc32_nostd as const_crc32; +/// /// const BYTES: &[u8] = "The quick brown fox jumps over the lazy dog".as_bytes(); /// /// let mut cksum = 0u32; @@ -72,6 +76,8 @@ pub const fn crc32(buf: &[u8]) -> u32 { /// on what kind of data the bytes represent: /// /// ``` +/// use const_crc32_nostd as const_crc32; +/// /// const THING_ONE_SEED: u32 = 0xbaaaaaad_u32; /// const THING_TWO_SEED: u32 = 0x2bad2bad_u32; ///