in reply to String to Byte array
That usage of Convert.ToByte( string, 16 ) converts a 2-digit hex string to an unsigned 8-bit integer.
The direct equivalent in Perl would be unpack 'H2', substr $key, $i*2, 2;.
But then you'll need to convert that integer into a character and pack it back into a string.
But, you have a bigger problem if your example "AJDAHSDJ213718327DSFSDJFHSDKFJ87348171837" is obtained from somewhere rather than just made up? J, K, H & S are not hex digits.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: String to Byte array
by toolic (Bishop) on Sep 19, 2013 at 16:51 UTC | |
by kpaxian25 (Novice) on Sep 20, 2013 at 21:29 UTC | |
|
Re^2: String to Byte array
by kpaxian25 (Novice) on Sep 20, 2013 at 21:12 UTC |