Net::FCP::Util - utility functions.
Returns the uppercased version of the given identifier. Used internally to map from e.g. URIError/KeyCollision to the form used in this module, i.e. uri_error/key_collision etc.
Returns the lowercased version of the given identifier. See
The opposite of
hex, i.e. returns the the number as hex string. Mainly useful due to it's prototype of
Calculate the (integer) log2 of a number, rounded up. If
$minlog is given it will be the minimum value returned.
Encode the given number as a multiple-precision number (2 byte bitlength + bytes)
Decode freenet's perverted version of base64.
Encode into freenet's perverted version of base64.
Generate and return they hash portion (the part after the comma, the crypto key) that would be used in the CHK (as binary). This can be used to verify contents of a CHK, since this key is a hash over the data.
(This function assumes a 128 bit key, which seems standard in freenet).
Extract the hash portion (the part after the comma, the crypto key) of a CHK (in binary). Useful to compare against the output of generate_chk_key.
Not heavily tested.
Marc Lehmann <email@example.com> http://home.schmorp.de/