Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: packing into a byte token

by ikegami (Patriarch)
on Sep 21, 2011 at 01:45 UTC ( [id://927047]=note: print w/replies, xml ) Need Help??


in reply to Re: packing into a byte token
in thread packing into a byte token

Need to xor each byte, so
use List::Util qw( reduce ); my $token = pack 'NN', time, $employee_id; $token .= reduce { $a ^ $b } split //, $token;

Use "V" instead of "N" if you need the opposite byte order.

Replies are listed 'Best First'.
Re^3: packing into a byte token
by jwkrahn (Abbot) on Sep 21, 2011 at 02:01 UTC
    Need to xor each byte

    Because?

      That's what the OP asked for.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-28 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found