Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chacha etc. documentation? #646

Closed
rukai opened this issue Nov 16, 2018 · 9 comments
Closed

chacha etc. documentation? #646

rukai opened this issue Nov 16, 2018 · 9 comments
Labels
C-docs Documentation E-help-wanted Participation: help wanted

Comments

@rukai
Copy link

rukai commented Nov 16, 2018

On this page the links to chacha and hc128 does not point to an actual page: https://docs.rs/rand/0.6.0/rand/rngs/struct.StdRng.html

Also https://rust-random.github.io/book/guide-rngs.html this page mentions chacha and other rngs and seems to imply they are in the rngs module, but I cant find it there or anywhere else.

@dhardy
Copy link
Member

dhardy commented Nov 16, 2018

@rukai
Copy link
Author

rukai commented Nov 17, 2018

Ok, so if I understand this correctly.
Because StdRng claims "Reproducibility of output from this generator is however not required"
I need both the rand crate and a secondary crate e.g. rand_chacha in order to ensure the same seed will always generate the same sequence of random numbers?

@dhardy
Copy link
Member

dhardy commented Nov 17, 2018

If you want reproducibility, use (for example) ChaChaRng, which is provided by rand_chacha. Don't use StdRng because we reserve the right to change the algorithm in the future.

@rukai
Copy link
Author

rukai commented Nov 17, 2018

Ah, my bad, it wasnt clear what the point of my question was.
It looks like I need to include two crates in my Cargo.toml in order to use chacha. rand and rand_chacha. Is this correct?

@dhardy
Copy link
Member

dhardy commented Nov 17, 2018

Yes, you need both.

@dhardy
Copy link
Member

dhardy commented Nov 20, 2018

My mistake with the link; I've used relative links from the book but should probably only use absolute links from the API docs because they can be hosted on a different site (currently these links work from here but not docs.rs).

  • Fix relative links from API to book found by rg "\.\./rand_"
  • Mention where to find other RNGs in the guide

@dhardy
Copy link
Member

dhardy commented Nov 22, 2018

The broken relative links are to other Rand project crates, not to the book. I'd prefer not to use absolute links everywhere.

@vks @burdges @newpavlov should we just make https://rust-random.github.io/rand/ the official API documentation, and not link to docs.rs? Maybe even add a note at the top stating that this is intended to be read from that URL (or a local build)?

@newpavlov
Copy link
Member

Personally I prefer to use docs.rs for documentation in my projects. Also when I explore a crates I often simply type docs.rs/<crate_name> into browser.

@dhardy
Copy link
Member

dhardy commented Jan 10, 2019

If the docs.rs folks would fix this issue I'd be happy to go back to that as the primary source of documentation — it does have advantages, such as always being true to the current release version instead of the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-docs Documentation E-help-wanted Participation: help wanted
Projects
None yet
Development

No branches or pull requests

3 participants