golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.88k stars 17.52k forks source link

all: decide on the hyphenation of pseudorandom vs pseudo-random? #25959

Open bradfitz opened 6 years ago

bradfitz commented 6 years ago

The docs for crypto/rand contain both "pseudorandom" and "pseudo-random" for the same part of speech.

Decide which to use.

Also, the package doc says:

Package rand implements a cryptographically secure pseudorandom number generator.

But the Reader says:

Reader is a global, shared instance of a cryptographically strong pseudo-random generator.

Is it cryptographically "strong" or is it "secure"? Can we pick a word there too?

Or can we just remove "pseudorandom" altogether? I feel like it makes it sound too much like math/rand.

Can we just say "cryptographically secure random number generator"?

/cc @FiloSottile @agl @ianlancetaylor

ianlancetaylor commented 6 years ago

CC @robpike

smasher164 commented 6 years ago

I see what you meant by your comment now :) It looks like "pseudorandom" is a valid English word: https://www.merriam-webster.com/dictionary/pseudorandom Additionally, words with the prefix "pseudo-" are apparently not hyphenated: http://www.mit.edu/course/21/21.guide/hyphen.htm

Secure vs Strong: If we had to choose, I'd go with secure since even the man page for /dev/[u]random mentions the following under "Usage":

the output is cryptographically secure against attackers without local root access as soon as it is reloaded in the boot sequence

TLDR, we may want to mention that crypto/rand implements a CSPRNG (cryptographically secure pseudorandom number generator).

robpike commented 6 years ago

I prefer pseudo-random and that's what math/rand uses, so that's my vote.

Generally, in English phrases become adjectives by hyphenation, and then after a long period of consistent usage the hyphens drop, but I don't believe pseudo-random is ready to lose its hyphen yet.

FiloSottile commented 6 years ago

"cryptographically secure random number generator"

Too many people go from that "pseudo" to "but I need real randomness!" and then you end up with /dev/random.

gopherbot commented 6 years ago

Change https://golang.org/cl/119875 mentions this issue: crypto/rand: make documentation consistent between package comment and Reader