NAME

Dipki::Cnv - Character conversion routines.

Notes

Dipki::Cnv::ToHex($buf) is equivalent to unpack('H*', $buf);
Dipki::Cnv::FromHex($s) is equivalent to pack('H*', $s); but is more flexible.

FromBase64 function

Decode a base64-encoded string into a byte array.

Warning

Whitespace characters are ignored, but other non-base64 characters will cause an error.

ToBase64 function

Encode binary data as a base64 string.

FromHex function

Decode a hexadecimal-encoded string into a byte array

Warning

Whitespace and ASCII punctuation characters in the input are ignored, but other non-hex characters, e.g. [G-Zg-z], will cause an error.

ToHex function

Encode binary data as a hexadecimal string.

ReverseBytes function

Reverse the order of a byte array.

NumFromBytes function

Convert the leftmost four bytes of an array to a 32-bit integer.

NumToBytes function

Convert a 32-bit integer to an array of 4 bytes.

AUTHOR

David Ireland, https://www.cryptosys.net/contact/

COPYRIGHT AND LICENSE

Copyright (C) 2022 David Ireland, DI Management Services Pty Limited, https://www.di-mgt.com.au https://www.cryptosys.net. The code in this module is licensed under the terms of the MIT license. For a copy, see http://opensource.org/licenses/MIT