on 18-Mar-2015 14:26
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" }