Forum Discussion

Ian_Smith's avatar
Ian_Smith
Ret. Employee
Aug 23, 2006

curious results from md5

when I do this on 9.1.2 or 9.2.3:

 

 

when CLIENT_ACCEPTED {

 

set client [IP::client_addr]

 

set clienthash [md5 [IP::client_addr]]

 

log "the client is: $client the clienthash is: $clienthash "

 

}

 

 

 

I get log entries like this:

 

the client is: 10.10.91.1 the clienthash is: "ª¨4ÙÁWh²ÄÒ(·èr

 

 

but I expect that clienthash should be:

 

db6e0e56e15da22be2bae7fb51139b6e

 

 

Are my expectations wrong, or is something not working right?

 

 

12 Replies

  • Was there ever any movement here to fix the F5 implementation of md5?

     

    We are about to deploy a load balanced cache cluster into production and this would be optimal.

     

     

  • Dear all,

     

    I was following this threath, since I was facing a simular issue.

     

     

    when CLIENT_ACCEPTED {

     

    binary scan [md5 [IP::client_addr]] w1 clienthash

     

    set picked [lindex [active_members -list hackit_pool] [expr {$clienthash % [active_members hackit_pool]}]]

     

    pool hackit_pool member [lindex $picked 0] [lindex $picked 1]

     

    }

     

     

    the issue was that the binary Scan did not generate a Numeric Value but a Binary Value.

     

    binary scan [md5 [IP::client_addr]] w1 clienthash

     

    generates a Value $clienthash available for the expression.

     

    http://www.tcl.tk/man/tcl8.4/TclCmd/binary.htmM24

     

    Kind Regards

     

    jwiesmann