diff -Nru rust-rand-isaac-0.1.1/Cargo.toml rust-rand-isaac-0.2.0/Cargo.toml --- rust-rand-isaac-0.1.1/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-rand-isaac-0.2.0/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -3,7 +3,7 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies +# to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're @@ -11,33 +11,30 @@ # will likely look very different (and much more reasonable) [package] +edition = "2018" name = "rand_isaac" -version = "0.1.1" +version = "0.2.0" authors = ["The Rand Project Developers", "The Rust Project Developers"] description = "ISAAC random number generator\n" homepage = "https://crates.io/crates/rand_isaac" -documentation = "https://rust-random.github.io/rand/rand_isaac" +documentation = "https://rust-random.github.io/rand/rand_isaac/" readme = "README.md" keywords = ["random", "rng", "isaac"] categories = ["algorithms", "no-std"] license = "MIT/Apache-2.0" repository = "https://github.com/rust-random/rand" [dependencies.rand_core] -version = "0.3" -default-features = false +version = "0.5" [dependencies.serde] version = "1" -optional = true - -[dependencies.serde_derive] -version = "^1.0.38" +features = ["derive"] optional = true [dev-dependencies.bincode] version = "1" [features] -serde1 = ["serde", "serde_derive", "rand_core/serde1"] +serde1 = ["serde", "rand_core/serde1"] [badges.appveyor] repository = "rust-random/rand" diff -Nru rust-rand-isaac-0.1.1/Cargo.toml.orig rust-rand-isaac-0.2.0/Cargo.toml.orig --- rust-rand-isaac-0.1.1/Cargo.toml.orig 2018-11-25 11:18:02.000000000 +0000 +++ rust-rand-isaac-0.2.0/Cargo.toml.orig 2019-06-11 15:26:28.000000000 +0000 @@ -1,29 +1,29 @@ [package] name = "rand_isaac" -version = "0.1.1" +version = "0.2.0" authors = ["The Rand Project Developers", "The Rust Project Developers"] license = "MIT/Apache-2.0" readme = "README.md" repository = "https://github.com/rust-random/rand" -documentation = "https://rust-random.github.io/rand/rand_isaac" +documentation = "https://rust-random.github.io/rand/rand_isaac/" homepage = "https://crates.io/crates/rand_isaac" description = """ ISAAC random number generator """ keywords = ["random", "rng", "isaac"] categories = ["algorithms", "no-std"] +edition = "2018" [badges] travis-ci = { repository = "rust-random/rand" } appveyor = { repository = "rust-random/rand" } [features] -serde1 = ["serde", "serde_derive", "rand_core/serde1"] +serde1 = ["serde", "rand_core/serde1"] [dependencies] -rand_core = { path = "../rand_core", version = "0.3", default-features=false } -serde = { version = "1", optional = true } -serde_derive = { version = "^1.0.38", optional = true } +rand_core = { path = "../rand_core", version = "0.5" } +serde = { version = "1", features = ["derive"], optional = true } [dev-dependencies] # This is for testing serde, unfortunately we can't specify feature-gated dev diff -Nru rust-rand-isaac-0.1.1/.cargo_vcs_info.json rust-rand-isaac-0.2.0/.cargo_vcs_info.json --- rust-rand-isaac-0.1.1/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-rand-isaac-0.2.0/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "6add2fd439f959989ee371b3eab94607fe173ece" + "sha1": "5610bdae3acdb0324f5636bb3e4a21e6324ead72" } } diff -Nru rust-rand-isaac-0.1.1/CHANGELOG.md rust-rand-isaac-0.2.0/CHANGELOG.md --- rust-rand-isaac-0.1.1/CHANGELOG.md 2018-11-25 11:20:07.000000000 +0000 +++ rust-rand-isaac-0.2.0/CHANGELOG.md 2019-06-11 15:26:28.000000000 +0000 @@ -4,6 +4,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.0] - 2019-06-12 +- Bump minor crate version since rand_core bump is a breaking change +- Switch to Edition 2018 + +## [0.1.2] - 2019-06-06 - yanked +- Bump `rand_core` version +- Remove deprecated code +- Adjust usage of `#[inline]` + ## [0.1.1] - 2018-11-26 - Fix `rand_core` version requirement - Fix doc links diff -Nru rust-rand-isaac-0.1.1/debian/cargo-checksum.json rust-rand-isaac-0.2.0/debian/cargo-checksum.json --- rust-rand-isaac-0.1.1/debian/cargo-checksum.json 2019-01-05 18:51:10.000000000 +0000 +++ rust-rand-isaac-0.2.0/debian/cargo-checksum.json 2019-08-29 14:48:05.000000000 +0000 @@ -1 +1 @@ -{"package":"ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08","files":{}} +{"package":"8df6b0b3dc9991a10b2d91a86d1129314502169a1bf6afa67328945e02498b76","files":{}} diff -Nru rust-rand-isaac-0.1.1/debian/changelog rust-rand-isaac-0.2.0/debian/changelog --- rust-rand-isaac-0.1.1/debian/changelog 2019-01-05 18:51:10.000000000 +0000 +++ rust-rand-isaac-0.2.0/debian/changelog 2019-08-29 14:48:05.000000000 +0000 @@ -1,3 +1,10 @@ +rust-rand-isaac (0.2.0-1) unstable; urgency=medium + + * Team upload. + * Package rand_isaac 0.2.0 from crates.io using debcargo 2.4.0 + + -- Ximin Luo Thu, 29 Aug 2019 07:48:05 -0700 + rust-rand-isaac (0.1.1-1) unstable; urgency=medium * Package rand_isaac 0.1.1 from crates.io using debcargo 2.2.9 diff -Nru rust-rand-isaac-0.1.1/debian/control rust-rand-isaac-0.2.0/debian/control --- rust-rand-isaac-0.1.1/debian/control 2019-01-05 18:51:10.000000000 +0000 +++ rust-rand-isaac-0.2.0/debian/control 2019-08-29 14:48:05.000000000 +0000 @@ -2,11 +2,11 @@ Section: rust Priority: optional Build-Depends: debhelper (>= 11), - dh-cargo (>= 10), + dh-cargo (>= 18), cargo:native , rustc:native , libstd-rust-dev , - librust-rand-core-0.3-dev + librust-rand-core-0.5+default-dev Maintainer: Debian Rust Maintainers Uploaders: Wolfgang Silbermayr @@ -21,19 +21,18 @@ Multi-Arch: same Depends: ${misc:Depends}, - librust-rand-core-0.3-dev + librust-rand-core-0.5+default-dev Suggests: librust-rand-isaac+serde-dev (= ${binary:Version}), - librust-rand-isaac+serde1-dev (= ${binary:Version}), - librust-rand-isaac+serde-derive-dev (= ${binary:Version}) + librust-rand-isaac+serde1-dev (= ${binary:Version}) Provides: librust-rand-isaac+default-dev (= ${binary:Version}), librust-rand-isaac-0-dev (= ${binary:Version}), librust-rand-isaac-0+default-dev (= ${binary:Version}), - librust-rand-isaac-0.1-dev (= ${binary:Version}), - librust-rand-isaac-0.1+default-dev (= ${binary:Version}), - librust-rand-isaac-0.1.1-dev (= ${binary:Version}), - librust-rand-isaac-0.1.1+default-dev (= ${binary:Version}) + librust-rand-isaac-0.2-dev (= ${binary:Version}), + librust-rand-isaac-0.2+default-dev (= ${binary:Version}), + librust-rand-isaac-0.2.0-dev (= ${binary:Version}), + librust-rand-isaac-0.2.0+default-dev (= ${binary:Version}) Description: ISAAC random number generator - Rust source code This package contains the source for the Rust rand_isaac crate, packaged by debcargo for use with cargo and dh-cargo. @@ -44,13 +43,14 @@ Depends: ${misc:Depends}, librust-rand-isaac-dev (= ${binary:Version}), - librust-serde-1+default-dev + librust-serde-1+default-dev, + librust-serde-1+derive-dev Provides: librust-rand-isaac-0+serde-dev (= ${binary:Version}), - librust-rand-isaac-0.1+serde-dev (= ${binary:Version}), - librust-rand-isaac-0.1.1+serde-dev (= ${binary:Version}) + librust-rand-isaac-0.2+serde-dev (= ${binary:Version}), + librust-rand-isaac-0.2.0+serde-dev (= ${binary:Version}) Description: ISAAC random number generator - feature "serde" - This metapackage enables feature serde for the Rust rand_isaac crate, by + This metapackage enables feature "serde" for the Rust rand_isaac crate, by pulling in any additional dependencies needed by that feature. Package: librust-rand-isaac+serde1-dev @@ -59,28 +59,13 @@ Depends: ${misc:Depends}, librust-rand-isaac-dev (= ${binary:Version}), - librust-rand-core-0.3+serde1-dev, + librust-rand-core-0.5+serde1-dev, librust-serde-1+default-dev, - librust-serde-derive-1+default-dev (>= 1.0.38-~~) + librust-serde-1+derive-dev Provides: librust-rand-isaac-0+serde1-dev (= ${binary:Version}), - librust-rand-isaac-0.1+serde1-dev (= ${binary:Version}), - librust-rand-isaac-0.1.1+serde1-dev (= ${binary:Version}) + librust-rand-isaac-0.2+serde1-dev (= ${binary:Version}), + librust-rand-isaac-0.2.0+serde1-dev (= ${binary:Version}) Description: ISAAC random number generator - feature "serde1" - This metapackage enables feature serde1 for the Rust rand_isaac crate, by - pulling in any additional dependencies needed by that feature. - -Package: librust-rand-isaac+serde-derive-dev -Architecture: any -Multi-Arch: same -Depends: - ${misc:Depends}, - librust-rand-isaac-dev (= ${binary:Version}), - librust-serde-derive-1+default-dev (>= 1.0.38-~~) -Provides: - librust-rand-isaac-0+serde-derive-dev (= ${binary:Version}), - librust-rand-isaac-0.1+serde-derive-dev (= ${binary:Version}), - librust-rand-isaac-0.1.1+serde-derive-dev (= ${binary:Version}) -Description: ISAAC random number generator - feature "serde_derive" - This metapackage enables feature serde_derive for the Rust rand_isaac crate, by + This metapackage enables feature "serde1" for the Rust rand_isaac crate, by pulling in any additional dependencies needed by that feature. diff -Nru rust-rand-isaac-0.1.1/debian/tests/control rust-rand-isaac-0.2.0/debian/tests/control --- rust-rand-isaac-0.1.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ rust-rand-isaac-0.2.0/debian/tests/control 2019-08-29 14:48:05.000000000 +0000 @@ -0,0 +1,15 @@ +Test-Command: /usr/share/cargo/bin/cargo-auto-test rand_isaac 0.2.0 --all-targets --all-features +Depends: dh-cargo (>= 18), librust-bincode-1+default-dev, @ +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test rand_isaac 0.2.0 --all-targets --no-default-features +Depends: dh-cargo (>= 18), librust-bincode-1+default-dev, librust-rand-isaac-dev +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test rand_isaac 0.2.0 --all-targets --features serde +Depends: dh-cargo (>= 18), librust-bincode-1+default-dev, librust-rand-isaac+serde-dev +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test rand_isaac 0.2.0 --all-targets --features serde1 +Depends: dh-cargo (>= 18), librust-bincode-1+default-dev, librust-rand-isaac+serde1-dev +Restrictions: allow-stderr, skip-not-installable diff -Nru rust-rand-isaac-0.1.1/README.md rust-rand-isaac-0.2.0/README.md --- rust-rand-isaac-0.1.1/README.md 2018-11-23 10:42:34.000000000 +0000 +++ rust-rand-isaac-0.2.0/README.md 2019-06-11 09:07:48.000000000 +0000 @@ -6,7 +6,7 @@ [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_isaac) [![API](https://docs.rs/rand_isaac/badge.svg)](https://docs.rs/rand_isaac) -[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.32+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) Implements the ISAAC and ISAAC-64 random number generators. @@ -22,7 +22,7 @@ - [API documentation (master)](https://rust-random.github.io/rand/rand_isaac) - [API documentation (docs.rs)](https://docs.rs/rand_isaac) -- [Changelog](CHANGELOG.md) +- [Changelog](https://github.com/rust-random/rand/blob/master/rand_isaac/CHANGELOG.md) [rand]: https://crates.io/crates/rand [^1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number generator*](http://burtleburtle.net/bob/rand/isaacafa.html) diff -Nru rust-rand-isaac-0.1.1/src/isaac64.rs rust-rand-isaac-0.2.0/src/isaac64.rs --- rust-rand-isaac-0.1.1/src/isaac64.rs 2018-11-22 17:41:16.000000000 +0000 +++ rust-rand-isaac-0.2.0/src/isaac64.rs 2019-06-11 15:26:28.000000000 +0000 @@ -11,9 +11,10 @@ use core::{fmt, slice}; use core::num::Wrapping as w; +#[cfg(feature="serde1")] use serde::{Serialize, Deserialize}; use rand_core::{RngCore, SeedableRng, Error, le}; use rand_core::block::{BlockRngCore, BlockRng64}; -use isaac_array::IsaacArray; +use crate::isaac_array::IsaacArray; #[allow(non_camel_case_types)] type w64 = w; @@ -40,8 +41,8 @@ /// In spite of being designed with cryptographic security in mind, ISAAC hasn't /// been stringently cryptanalyzed and thus cryptographers do not not /// consensually trust it to be secure. When looking for a secure RNG, prefer -/// [`Hc128Rng`] instead, which, like ISAAC, is an array-based RNG and one of -/// the stream-ciphers selected the by eSTREAM contest. +/// `Hc128Rng` from the [`rand_hc`] crate instead, which, like ISAAC, is an +/// array-based RNG and one of the stream-ciphers selected the by eSTREAM /// /// ## Overview of the ISAAC-64 algorithm: /// (in pseudo-code) @@ -75,29 +76,30 @@ /// [^1]: Bob Jenkins, [*ISAAC and RC4*]( /// http://burtleburtle.net/bob/rand/isaac.html) /// -/// [`IsaacRng`]: ../isaac/struct.IsaacRng.html -/// [`Hc128Rng`]: ../../rand_hc/struct.Hc128Rng.html -/// [`BlockRng64`]: ../../rand_core/block/struct.BlockRng64.html -/// [`RngCore`]: ../../rand_core/trait.RngCore.html +/// [`IsaacRng`]: crate::isaac::IsaacRng +/// [`rand_hc`]: https://docs.rs/rand_hc +/// [`BlockRng64`]: rand_core::block::BlockRng64 #[derive(Clone, Debug)] #[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] pub struct Isaac64Rng(BlockRng64); impl RngCore for Isaac64Rng { - #[inline(always)] + #[inline] fn next_u32(&mut self) -> u32 { self.0.next_u32() } - #[inline(always)] + #[inline] fn next_u64(&mut self) -> u64 { self.0.next_u64() } + #[inline] fn fill_bytes(&mut self, dest: &mut [u8]) { self.0.fill_bytes(dest) } + #[inline] fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { self.0.try_fill_bytes(dest) } @@ -106,6 +108,7 @@ impl SeedableRng for Isaac64Rng { type Seed = ::Seed; + #[inline] fn from_seed(seed: Self::Seed) -> Self { Isaac64Rng(BlockRng64::::from_seed(seed)) } @@ -113,25 +116,17 @@ /// Create an ISAAC random number generator using an `u64` as seed. /// If `seed == 0` this will produce the same stream of random numbers as /// the reference implementation when used unseeded. + #[inline] fn seed_from_u64(seed: u64) -> Self { Isaac64Rng(BlockRng64::::seed_from_u64(seed)) } + #[inline] fn from_rng(rng: S) -> Result { BlockRng64::::from_rng(rng).map(|rng| Isaac64Rng(rng)) } } -impl Isaac64Rng { - /// Create an ISAAC-64 random number generator using an `u64` as seed. - /// If `seed == 0` this will produce the same stream of random numbers as - /// the reference implementation when used unseeded. - #[deprecated(since="0.6.0", note="use SeedableRng::seed_from_u64 instead")] - pub fn new_from_u64(seed: u64) -> Self { - Self::seed_from_u64(seed) - } -} - /// The core of `Isaac64Rng`, used with `BlockRng`. #[derive(Clone)] #[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] @@ -155,10 +150,10 @@ type Results = IsaacArray; /// Refills the output buffer, `results`. See also the pseudocode desciption - /// of the algorithm in the [`Isaac64Rng`] documentation. + /// of the algorithm in the `Isaac64Rng` documentation. /// /// Optimisations used (similar to the reference implementation): - /// + /// /// - The loop is unrolled 4 times, once for every constant of mix(). /// - The contents of the main loop are moved to a function `rngstep`, to /// reduce code duplication. @@ -173,8 +168,6 @@ /// from `results` in reverse. We read them in the normal direction, to /// make `fill_bytes` a memcopy. To maintain compatibility we fill in /// reverse. - /// - /// [`Isaac64Rng`]: struct.Isaac64Rng.html fn generate(&mut self, results: &mut IsaacArray) { self.c += w(1); // abbreviations @@ -274,14 +267,6 @@ Self { mem, a: w(0), b: w(0), c: w(0) } } - - /// Create an ISAAC-64 random number generator using an `u64` as seed. - /// If `seed == 0` this will produce the same stream of random numbers as - /// the reference implementation when used unseeded. - #[deprecated(since="0.6.0", note="use SeedableRng::seed_from_u64 instead")] - pub fn new_from_u64(seed: u64) -> Self { - Self::seed_from_u64(seed) - } } impl SeedableRng for Isaac64Core { @@ -297,7 +282,7 @@ } Self::init(seed_extended, 2) } - + fn seed_from_u64(seed: u64) -> Self { let mut key = [w(0); RAND_SIZE]; key[0] = w(seed); diff -Nru rust-rand-isaac-0.1.1/src/isaac_array.rs rust-rand-isaac-0.2.0/src/isaac_array.rs --- rust-rand-isaac-0.1.1/src/isaac_array.rs 2018-11-22 17:41:16.000000000 +0000 +++ rust-rand-isaac-0.2.0/src/isaac_array.rs 2019-06-11 15:26:28.000000000 +0000 @@ -13,7 +13,7 @@ // implement `AsRef`, `Default`, `Serialize`, `Deserialize`, or any other // traits for that matter. -#[cfg(feature="serde1")] use serde::{Serialize, Deserialize}; +#[cfg(feature="serde")] use serde::{Serialize, Deserialize}; const RAND_SIZE_LEN: usize = 8; const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; @@ -21,10 +21,10 @@ #[derive(Copy, Clone)] #[allow(missing_debug_implementations)] -#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +#[cfg_attr(feature="serde", derive(Serialize, Deserialize))] pub struct IsaacArray { - #[cfg_attr(feature="serde1",serde(with="isaac_array_serde"))] - #[cfg_attr(feature="serde1", serde(bound( + #[cfg_attr(feature="serde",serde(with="isaac_array_serde"))] + #[cfg_attr(feature="serde", serde(bound( serialize = "T: Serialize", deserialize = "T: Deserialize<'de> + Copy + Default")))] inner: [T; RAND_SIZE] @@ -66,7 +66,7 @@ } -#[cfg(feature="serde1")] +#[cfg(feature="serde")] pub(super) mod isaac_array_serde { const RAND_SIZE_LEN: usize = 8; const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; diff -Nru rust-rand-isaac-0.1.1/src/isaac.rs rust-rand-isaac-0.2.0/src/isaac.rs --- rust-rand-isaac-0.1.1/src/isaac.rs 2018-11-22 17:41:16.000000000 +0000 +++ rust-rand-isaac-0.2.0/src/isaac.rs 2019-06-11 15:26:28.000000000 +0000 @@ -11,9 +11,10 @@ use core::{fmt, slice}; use core::num::Wrapping as w; +#[cfg(feature="serde1")] use serde::{Serialize, Deserialize}; use rand_core::{RngCore, SeedableRng, Error, le}; use rand_core::block::{BlockRngCore, BlockRng}; -use isaac_array::IsaacArray; +use crate::isaac_array::IsaacArray; #[allow(non_camel_case_types)] type w32 = w; @@ -34,8 +35,8 @@ /// In spite of being designed with cryptographic security in mind, ISAAC hasn't /// been stringently cryptanalyzed and thus cryptographers do not not /// consensually trust it to be secure. When looking for a secure RNG, prefer -/// [`Hc128Rng`] instead, which, like ISAAC, is an array-based RNG and one of -/// the stream-ciphers selected the by eSTREAM contest. +/// `Hc128Rng` from the [`rand_hc`] crate instead, which, like ISAAC, is an +/// array-based RNG and one of the stream-ciphers selected the by eSTREAM /// /// In 2006 an improvement to ISAAC was suggested by Jean-Philippe Aumasson, /// named ISAAC+[^3]. But because the specification is not complete, because @@ -86,28 +87,28 @@ /// [^3]: Jean-Philippe Aumasson, [*On the pseudo-random generator ISAAC*]( /// https://eprint.iacr.org/2006/438) /// -/// [`Hc128Rng`]: ../../rand_hc/struct.Hc128Rng.html -/// [`BlockRng`]: ../../rand_core/block/struct.BlockRng.html -/// [`RngCore`]: ../../rand_core/trait.RngCore.html +/// [`rand_hc`]: https://docs.rs/rand_hc #[derive(Clone, Debug)] #[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] pub struct IsaacRng(BlockRng); impl RngCore for IsaacRng { - #[inline(always)] + #[inline] fn next_u32(&mut self) -> u32 { self.0.next_u32() } - #[inline(always)] + #[inline] fn next_u64(&mut self) -> u64 { self.0.next_u64() } + #[inline] fn fill_bytes(&mut self, dest: &mut [u8]) { self.0.fill_bytes(dest) } + #[inline] fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { self.0.try_fill_bytes(dest) } @@ -116,33 +117,26 @@ impl SeedableRng for IsaacRng { type Seed = ::Seed; + #[inline] fn from_seed(seed: Self::Seed) -> Self { IsaacRng(BlockRng::::from_seed(seed)) } - + /// Create an ISAAC random number generator using an `u64` as seed. /// If `seed == 0` this will produce the same stream of random numbers as /// the reference implementation when used unseeded. + #[inline] fn seed_from_u64(seed: u64) -> Self { IsaacRng(BlockRng::::seed_from_u64(seed)) } + #[inline] fn from_rng(rng: S) -> Result { BlockRng::::from_rng(rng).map(|rng| IsaacRng(rng)) } } -impl IsaacRng { - /// Create an ISAAC random number generator using an `u64` as seed. - /// If `seed == 0` this will produce the same stream of random numbers as - /// the reference implementation when used unseeded. - #[deprecated(since="0.6.0", note="use SeedableRng::seed_from_u64 instead")] - pub fn new_from_u64(seed: u64) -> Self { - Self::seed_from_u64(seed) - } -} - -/// The core of `IsaacRng`, used with `BlockRng`. +/// The core of [`IsaacRng`], used with [`BlockRng`]. #[derive(Clone)] #[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] pub struct IsaacCore { @@ -165,10 +159,10 @@ type Results = IsaacArray; /// Refills the output buffer, `results`. See also the pseudocode desciption - /// of the algorithm in the [`IsaacRng`] documentation. + /// of the algorithm in the `IsaacRng` documentation. /// /// Optimisations used (similar to the reference implementation): - /// + /// /// - The loop is unrolled 4 times, once for every constant of mix(). /// - The contents of the main loop are moved to a function `rngstep`, to /// reduce code duplication. @@ -183,8 +177,6 @@ /// from `results` in reverse. We read them in the normal direction, to /// make `fill_bytes` a memcopy. To maintain compatibility we fill in /// reverse. - /// - /// [`IsaacRng`]: struct.IsaacRng.html fn generate(&mut self, results: &mut IsaacArray) { self.c += w(1); // abbreviations @@ -324,7 +316,7 @@ } Self::init(seed_extended, 2) } - + /// Create an ISAAC random number generator using an `u64` as seed. /// If `seed == 0` this will produce the same stream of random numbers as /// the reference implementation when used unseeded. diff -Nru rust-rand-isaac-0.1.1/src/lib.rs rust-rand-isaac-0.2.0/src/lib.rs --- rust-rand-isaac-0.1.1/src/lib.rs 2018-11-23 10:42:34.000000000 +0000 +++ rust-rand-isaac-0.2.0/src/lib.rs 2019-06-11 15:26:28.000000000 +0000 @@ -16,16 +16,7 @@ #![deny(missing_debug_implementations)] #![doc(test(attr(allow(unused_variables), deny(warnings))))] -#![cfg_attr(not(all(feature="serde1", test)), no_std)] - -extern crate rand_core; - -#[cfg(feature="serde1")] extern crate serde; -#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive; - -// To test serialization we need bincode and the standard library -#[cfg(all(feature="serde1", test))] extern crate bincode; -#[cfg(all(feature="serde1", test))] extern crate std as core; +#![cfg_attr(not(all(feature="serde", test)), no_std)] pub mod isaac; pub mod isaac64;