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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

šŸ‘‹ Kindness is contagious

Please leave a ā¤ļø or a friendly comment on this post if you found it helpful!

Okay