Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Rearrange hex digits.

by ikegami (Pope)
on May 24, 2010 at 16:08 UTC ( #841422=note: print w/replies, xml ) Need Help??


in reply to Rearrange hex digits.

my $uuid = sprintf('%08X-%04X-%04X-%04X-%04X%08X', unpack 'V v v n nN', pack 'H*', $_);

Not that unreadable (relatively speaking). With 'n' and 'v', the size of the letter (lc vs uc) indicates the size of the field (16 vs 32 bit). 'n' keep order, 'v' reverses it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://841422]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-09-24 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?