CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
hooleylist
Cirrostratus
Cirrostratus

Problem this snippet solves:

Not sure I remember why I was doing this, but...

Here's a simple example to generate pseudo-random hex characters. Don't use this for encryption--instead use the crypto commands.

Code :

# Generate 32 random hex characters
when RULE_INIT {

for { set i 0 } {$i < 32 } { incr i } {
append rand_hex [format {%x} [expr {int(rand()*16)}]]
}
log local0. "\$rand_hex: $rand_hex"
}
Version history
Last update:
‎18-Mar-2015 14:26
Updated by:
Contributors