Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Split any number into string of 8-bit hex values (=1 byte)by LanX (Saint) |
on Aug 30, 2021 at 14:00 UTC ( [id://11136209]=note: print w/replies, xml ) | Need Help?? |
log(0) is undefined, so I designed a custom function hexbytes which returns a list of 0 padded bytes and special casing '00'. Please note how I kept the reverse and join outside for generic flexibility of use. NB: you must still take care of negative $n!
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|