function _openid_dh_binary_to_long in Drupal 6
Same name and namespace in other branches
- 7 modules/openid/openid.inc \_openid_dh_binary_to_long()
2 calls to _openid_dh_binary_to_long()
- _openid_dh_base64_to_long in modules/
openid/ openid.inc - _openid_dh_rand in modules/
openid/ openid.inc
File
- modules/
openid/ openid.inc, line 281 - OpenID utility functions.
Code
function _openid_dh_binary_to_long($str) {
$bytes = array_merge(unpack('C*', $str));
$n = 0;
foreach ($bytes as $byte) {
$n = bcmul($n, pow(2, 8));
$n = bcadd($n, $byte);
}
return $n;
}