-
-
Notifications
You must be signed in to change notification settings - Fork 791
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
Ported to ColdFusion/CFML #311
Comments
Does it use hardware random generator? |
I'm not sure... I'm still researching. I found this:
and this:
Which makes me think that it may not be possible to use Java's SecureRandom SHA1PRNG implementation (like the listed jnanoid library does) to generate a nanoid. (Does jnanoid use hardware random generator? source) ColdFusion server environments may vary link as well as the version of Java used. I may need to rewrite the function to support different security classes, but I'm attempting to use regular CFML so that nothing additional has to be installed and/or configured. |
The modern secure random generators works in two steps:
These two steps allows us to generate random numbers faster. We need to collect noise only once (the implementation is a little more complicated, but let’s simplify).
So, main question is who and how you set seed. |
It doesn’t pass anything to |
I've just updated the component and added support for all available CFML algorithms for RandRange(): |
Still not sure how it works, but seems very likely that it should work properly. Please send PR to docs with a link to your project to save your name in the project history. |
BTW, Thanks for responding so quickly! (It often takes me days, weeks, etc to get responses from some project maintainers.) |
BTW, I just noticed that the quantity of "ports other programming languages" was referenced in the project's readme intro. (The number should now reflect |
Yeap! And try to find the same number in Chinese and Russian docs. |
I've ported nanoid to ColdFusion/CFML.
https://github.com/JamoCA/cfml-nanoid
NOTE: The built-in
RandRange()
function leverages Java's SecureRandomSHA1PRNG
algorithm.The text was updated successfully, but these errors were encountered: