Skip to content

Instantly share code, notes, and snippets.

@shawnsi
Last active August 29, 2015 14:08
Show Gist options
  • Save shawnsi/baf05bd37a7fcd04eeeb to your computer and use it in GitHub Desktop.
Save shawnsi/baf05bd37a7fcd04eeeb to your computer and use it in GitHub Desktop.
F5 Transaction ID
when HTTP_REQUEST {
# Initialize the hex string variable
set hex ""
# Loop to create 8 random bytes
for {set i 0} {$i<8} {incr i} {
# Create a byte from the PRNG
set byte [expr { int(rand() * 256) }]
# Append the formatted byte to the hex string
append hex [format %x $byte]
}
HTTP::header replace X-Transaction $hex
}
@tomislacker
Copy link

Hey bro, there's no pow or floor functions in your F5...

@shawnsi
Copy link
Author

shawnsi commented Nov 3, 2014

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment