DEV Community

Cover image for Nano ID for ColdFusion/CFML
James Moberg
James Moberg

Posted on

2

Nano ID for ColdFusion/CFML

I wanted to use unique IDs in a project and the nanoid library looked interesting. There was a Java version available, but nothing available in ColdFusion/CFML. I didn't want to have to manually add a JAR file to my server, so I ported it and added support for:

  • multiple dictionaries (numbers, hexadecimalLowercase, hexadecimalUppercase, lowercase, uppercase, alphanumeric, nolookalikes & nolookalikesSafe)
  • multiple algorithms (SHA1PRNG, IBMSecureRandom, NativePRNG, NativePRNGBlocking & NativePRNGNonBlocking)

I also created a test script with ms/ns benchmarks and example code so that the results could be reviewed.

This was also my first ever #Hacktoberfest submission.

https://github.com/JamoCA/cfml-nanoid

Enjoy!

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay