This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # takes unix timestamp and converts to base36 | |
| # ht: https://en.wikipedia.org/wiki/Base36#bash_implementation | |
| value=$(date +%s) | |
| result="" | |
| base36="0123456789abcdefghijklmnopqrstuvwxyz" | |
| while true; do | |
| result=${base36:((value%36)):1}${result} | |
| if [ $((value=${value}/36)) -eq 0 ]; then |