Last active
May 18, 2016 15:15
-
-
Save rebolyte/f0e03e515388999468f2f2b32403fc80 to your computer and use it in GitHub Desktop.
Rebol ID generator
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
REBOL [] | |
generate-id: func [/length len /local chars out] [ | |
chars: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_" | |
out: copy "" | |
if none? len [ len: 8 ] | |
loop len [ | |
random/seed form now/precise | |
ind: random/secure length? chars | |
append out pick chars ind | |
] | |
out | |
] | |
loop 5 [ print generate-id ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment