Introducing Custom Suffixes in Puff 0.5.0

author avatar

Toru Maesaka

Founder and CEO

Puff version 0.5.0 is now available, adding the --suffix option for appending custom strings to generated values. This is especially useful for creators, designers, and curators who require unique file names or labeled identifiers in their workflow.

Puff works well for software testing and data indexing, but it is also valuable to digital creators and designers. Consistent file naming is essential when organizing a photo gallery, managing an order-sensitive sequence such as comic pages, or preparing batch uploads for a client. The --suffix option appends any string to the generated values, making it ideal for creating random file names in bulk. This saves you from having to come up with unique names and enter them manually. Here’s an example generating three random file names with custom suffixes.

$ puff uuid -n 3 --compact --suffix ".png"
6c5da9619e8f4f1bb782d73fe9fed7ff.png
995f7d7b59fa43efa7348ba0aeb600d9.png
675dcfbbfbc4482ba51326d99454b324.png

For projects where keeping files in order is important, Puff offers an additional advantage. Because Puff supports UUID version 7, which includes a millisecond resolution timestamp as prefix, generated file names are naturally sorted in chronological order.

$ puff uuid --version 7 -n 4 --compact --suffix ".png"
019743645c6f768791fb11572f166615.png
019743645c6f76cab130b4f670d509dc.png
019743645c6f76d29895cbc497649b6e.png
019743645c6f76d9a9222813ebdd082c.png

You can also use the --suffix option to label and organize values by project, client, or purpose.

$ puff uuid -n 2 --compact --suffix "-COMPANY-X" 
8a0de83fe5ca4cf69296a6a462385d0d-COMPANY-X
3b0c00fde3b74faca8d45a3c2a81df13-COMPANY-X

$ puff hex --bytes 32 -n 2 --suffix "-test-api-key"
35287d5b5cbdef950a380b8f65ab69c41a4edeaa13dbc7f86e8f3a74fc341d73-test-api-key
a1c7baa4f052b4cef261a3a0a7c3788519ff1209f8824c2b576f6daaa2734933-test-api-key

The --suffix option is available in Puff version 0.5.0 and later. If you’re using Homebrew on macOS, simply run the following command to install or update it.

$ brew install chronohq/tap/puff

For other platforms, download the latest release from the GitHub releases page. As always, Puff remains open source under the MIT license.

Did you enjoy the content? Follow us on LinkedIn to help us grow and continue delivering blog posts like this one. Your support is appreciated.