Closed JordanRickman closed 1 year ago
Even with the change to -
in the example, there is an inconsistency in the README.md documentation, which says:
The main module uses URL-friendly symbols (A-Za-z0-9_-) and returns an ID with 21 characters.
use nanoid::nanoid; fn main() { let id = nanoid!(); //=> "Yo1Tr9F3iF-LFHX9i9GvA" }
But then below that it says:
Symbols -,.() are not encoded in the URL. If used at the end of a link they could be identified as a punctuation symbol.
So it says -
isn't being used, but above it shows that -
is used.
The documentation at https://docs.rs/nanoid/latest/nanoid/ claims that the default alphabet is
A-Za-z0-9_~
. This is stated several times in the text, and there is a code example which claims it may generate a string with a tilde:However, tilde (
~
) is not URL-safe.nanoid::alphabet::SAFE
, which the documentation claims is the default alphabet, contains the hyphen in place of the tilde. Presumably this is correct, and the documentation text is wrong.