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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

šŸ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay