Forum Discussion
Magnum_IP
Nimbostratus
Feb 26, 2014Binary to decimal
I'm unfortunately stuck and need some help.
I have a variable with a binary value in it. I need to split the value in two; the first 64 bits and the remainder and store these in two new variabl...
Kevin_Stewart
Employee
Feb 28, 2014I'm not sure what you're expecting the decimal value to be, but here is perhaps one way to do this:
set data "nVkVI5xxeXvvzbGfFmarAfaDMTRTPnRlKVedR5oqcRGNaZFV8X3HfJ8RCLhIzdM5"
binary scan [b64decode $data] H* hdata
log local0. $hdata
set first [string range $hdata 0 15]
set last [string range $hdata 16 end]
log local0. $first
set dec [expr 0x$first]
log local0. $dec
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects