Meteor comes with a super useful little package called Random. It's already included as part of your application, but is easily overlooked, so let's take a quick look at it!
From the Meteor docs
Returns a unique identifier, such as "Jjwjg6gouWLXhMGKW", that is likely to be unique in the whole world. The optional argument n specifies the length of the identifier in characters and defaults to 17.
Without passing an argument, this will give you the same random 17 char string as Meteor assigns to the
_idof a new document.
If you wish to generate the
_idon the client, use this.
Returns a random string of printable characters with 6 bits of entropy per character. The optional argument n specifies the length of the secret string and defaults to 43 characters, or 256 bits of entropy. Use Random.secret for security-critical secrets that are intended for machine, rather than human, consumption.
Returns a number between 0 and 1, like Math.random.
Returns a random element of the given array or string.
Returns a random string of n hexadecimal digits.