It grabs a random word from the adjs array, and a random word from the nouns array, followed by grabbing a random five digit number created by taking the current timestamp and adding it to a randomly generated number.
We may go overkill on our random number, but it works nicely.
Then, when a user creates a new app, we call the haiku() command and create a random haiku like divine-dust-12990 for example.
The larger your dictionary, the more variety of words you get, but if it’s too large then that can slow things down so it’s nice to find a good balance there. We have our dictionary tied into an internal API so we retrieve a random list of adjectives and nouns to use, the list in this sample function is a representative of our usual randomly retrieved lists.
Our haiku names will be of use to users shortly with our next few updates as we get a couple new features ready to launch, but I wanted to share how we do this now. 🙂