CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Interesting question, how do you bitwise shift a long hex string ?

 



ningji
Novice

Jan 4, 2013, 12:32 PM

Post #1 of 3 (830 views)
Interesting question, how do you bitwise shift a long hex string ? Can't Post

say this is encryption, i have a key like this,
my $hexString = "D55A445A08C92C1208216D916AD839CE739CC10414119243FFE70B113C";

now i need to get rid of the last 3 bits,
basically

$newHexString = $hexString >> 3.

how can you do that in perl ?


FishMonger
Veteran / Moderator

Jan 4, 2013, 1:03 PM

Post #2 of 3 (823 views)
Re: [ningji] Interesting question, how do you bitwise shift a long hex string ? [In reply to] Can't Post

You'll want to use a combination of the hex() and sprintf() or printf() functions.

You will probably also need to use Math::BigInt or one of its brothers.


ningji
Novice

Jan 14, 2013, 8:39 AM

Post #3 of 3 (774 views)
Re: [FishMonger] Interesting question, how do you bitwise shift a long hex string ? [In reply to] Can't Post

BigInt is the one, thx !


In Reply To
You'll want to use a combination of the hex() and sprintf() or printf() functions.

You will probably also need to use Math::BigInt or one of its brothers.


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives