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

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

Okay