Completed
Push — master ( c16260...319f0f )
by cam
05:07
created

nanoSha2::string2binint()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
nop 2
dl 0
loc 19
rs 9.6333
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Main routine called from an application using this include.
5
 *
6
 * General usage:
7
 *   require_once('sha256.inc.php');
8
 *   $hashstr = spip_sha256('abc');
9
 *
10
 * @param string $str Chaîne dont on veut calculer le SHA
11
 * @return string Le SHA de la chaîne
12
 */
13
function spip_sha256($str) {
14
	return hash('sha256', $str);
15
}
16
17
/**
18
 * @param string $str Chaîne dont on veut calculer le SHA
19
 * @param bool $ig_func
20
 * @return string Le SHA de la chaîne
21
 * @deprecated
22
 */
23
function _nano_sha256($str, $ig_func = true) {
0 ignored issues
show
Unused Code introduced by
The parameter $ig_func is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
	return spip_sha256($str);
25
}
26
27
// 2009-07-23: Added check for function as the Suhosin plugin adds this routine.
28
if (!function_exists('sha256')) {
29
	/**
30
	 * Calcul du SHA256
31
	 *
32
	 * @param string $str Chaîne dont on veut calculer le SHA
33
	 * @param bool $ig_func
34
	 * @return string Le SHA de la chaîne
35
	 * @deprecated
36
	 */
37
	function sha256($str, $ig_func = true) { return spip_sha256($str); }
0 ignored issues
show
Unused Code introduced by
The parameter $ig_func is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
}