Also, just to add to what @Jon said you can also generate random strings using the Crypto node, so you might not need custom code:
I tend to forget about it, but @BillAlex reminded me recently over here.