PageRenderTime 51ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/doc/latex/classCXLHash.tex

https://github.com/Pogostick/YiiXL
LaTeX | 347 lines | 263 code | 84 blank | 0 comment | 0 complexity | 81ecd07caf725fe31b12571c1a3a8da5 MD5 | raw file
  1. \hypertarget{classCXLHash}{
  2. \section{CXLHash Class Reference}
  3. \label{classCXLHash}\index{CXLHash@{CXLHash}}
  4. }
  5. Inheritance diagram for CXLHash:\nopagebreak
  6. \begin{figure}[H]
  7. \begin{center}
  8. \leavevmode
  9. \includegraphics[width=370pt]{classCXLHash__inherit__graph}
  10. \end{center}
  11. \end{figure}
  12. Collaboration diagram for CXLHash:\nopagebreak
  13. \begin{figure}[H]
  14. \begin{center}
  15. \leavevmode
  16. \includegraphics[width=370pt]{classCXLHash__coll__graph}
  17. \end{center}
  18. \end{figure}
  19. \subsection*{Static Public Member Functions}
  20. \begin{DoxyCompactItemize}
  21. \item
  22. static \hyperlink{classCXLHash_a861d68beb0e1d6e79ff85d68212863dd}{generate} (\$hashLength=20, \$hashType=self::ALL)
  23. \item
  24. static \hyperlink{classCXLHash_ace936368fcb6b1d6d533c4d19cf7e596}{hash} (\$hashTarget=null, \$hashType=self::SHA1, \$hashLength=32, \$rawOutput=false)
  25. \end{DoxyCompactItemize}
  26. \subsection*{Data Fields}
  27. \begin{DoxyCompactItemize}
  28. \item
  29. const \hyperlink{classCXLHash_aa607ab5e557e6ebb60b85c5a20ad067f}{CLASS\_\-LOG\_\-TAG} = 'yiixl.core.components.CXLHash'
  30. \item
  31. const \hyperlink{classCXLHash_ab56e734000051e5c12c8c5cf6d8d160d}{ALL} = 0
  32. \item
  33. const \hyperlink{classCXLHash_a33fc57236d932860ab0ad8e8268e0c99}{ALPHA\_\-LOWER} = 1
  34. \item
  35. const \hyperlink{classCXLHash_a13afa6f8ce77da9bd4a5af5d473d0d8b}{ALPHA\_\-UPPER} = 2
  36. \item
  37. const \hyperlink{classCXLHash_a6bb7987358cd3de8e7c775094597e631}{ALPHA} = 3
  38. \item
  39. const \hyperlink{classCXLHash_a1acce0cfa5c3723599af4c7e325b4312}{ALPHA\_\-NUMERIC} = 4
  40. \item
  41. const \hyperlink{classCXLHash_a371814049e51cde466af6295bdfed4e3}{ALPHA\_\-LOWER\_\-NUMERIC} = 5
  42. \item
  43. const \hyperlink{classCXLHash_a19cabff2391d99103d1bf11b0ed2972e}{NUMERIC} = 6
  44. \item
  45. const \hyperlink{classCXLHash_aa15c0932a4cd96ab710478faace6ccb9}{ALPHA\_\-LOWER\_\-NUMERIC\_\-IDIOTPROOF} = 7
  46. \item
  47. const \hyperlink{classCXLHash_a66be2064e952a39f04c0a54d83d1c779}{MD5} = 1
  48. \item
  49. const \hyperlink{classCXLHash_a1ca7a04dcc397e382e3a4ee5e0e1b9a1}{SHA1} = 2
  50. \item
  51. const \hyperlink{classCXLHash_aeeccfbe476a8ab58ea0c3382287ff0e9}{CRC32} = 18
  52. \end{DoxyCompactItemize}
  53. \subsection*{Static Protected Attributes}
  54. \begin{DoxyCompactItemize}
  55. \item
  56. static \hyperlink{classCXLHash_a4ccb145eb796f708b107b1ed4069bd0f}{\$\_\-hashSeeds}
  57. \end{DoxyCompactItemize}
  58. \subsection{Detailed Description}
  59. Hash code/password helpers
  60. Definition at line 20 of file CXLHash.php.
  61. \subsection{Member Function Documentation}
  62. \hypertarget{classCXLHash_a861d68beb0e1d6e79ff85d68212863dd}{
  63. \index{CXLHash@{CXLHash}!generate@{generate}}
  64. \index{generate@{generate}!CXLHash@{CXLHash}}
  65. \subsubsection[{generate}]{\setlength{\rightskip}{0pt plus 5cm}static generate (
  66. \begin{DoxyParamCaption}
  67. \item[{\$}]{ hashLength = {\ttfamily 20}, }
  68. \item[{\$}]{ hashType = {\ttfamily self::ALL}}
  69. \end{DoxyParamCaption}
  70. )\hspace{0.3cm}{\ttfamily \mbox{[}static\mbox{]}}}}
  71. \label{classCXLHash_a861d68beb0e1d6e79ff85d68212863dd}
  72. Generates a unique hash code
  73. \begin{DoxyParams}{Parameters}
  74. \item[{\em int}]\$hashLength \end{DoxyParams}
  75. \begin{DoxyReturn}{Returns}
  76. string
  77. \end{DoxyReturn}
  78. Definition at line 87 of file CXLHash.php.
  79. \begin{DoxyCode}
  80. {
  81. // If we ain't got what you're looking for, return simple md5 hash...
  82. if ( ! isset( self::$_hashSeeds, self::$_hashSeeds[$hashType] ) || ! is_array
  83. ( self::$_hashSeeds[$hashType] ) )
  84. return md5( time() . time() );
  85. // Randomly pick elements from the array of seeds
  86. for ( $_i = 0, $_hash = null, $_size = count( self::$_hashSeeds[$hashType] )
  87. - 1; $_i < $hashLength; $_i++ )
  88. $_hash .= self::$_hashSeeds[$hashType][mt_rand( 0, $_size )];
  89. return $_hash;
  90. }
  91. \end{DoxyCode}
  92. \hypertarget{classCXLHash_ace936368fcb6b1d6d533c4d19cf7e596}{
  93. \index{CXLHash@{CXLHash}!hash@{hash}}
  94. \index{hash@{hash}!CXLHash@{CXLHash}}
  95. \subsubsection[{hash}]{\setlength{\rightskip}{0pt plus 5cm}static hash (
  96. \begin{DoxyParamCaption}
  97. \item[{\$}]{ hashTarget = {\ttfamily null}, }
  98. \item[{\$}]{ hashType = {\ttfamily self::SHA1}, }
  99. \item[{\$}]{ hashLength = {\ttfamily 32}, }
  100. \item[{\$}]{ rawOutput = {\ttfamily false}}
  101. \end{DoxyParamCaption}
  102. )\hspace{0.3cm}{\ttfamily \mbox{[}static\mbox{]}}}}
  103. \label{classCXLHash_ace936368fcb6b1d6d533c4d19cf7e596}
  104. Generic hashing method. Will hash any string or generate a random hash and hash that!
  105. \begin{DoxyParams}{Parameters}
  106. \item[{\em string}]\$hashTarget The value to hash.. \item[{\em integer}]\$hashType \mbox{[}optional\mbox{]} The type of hash to create. Can be \{\end{DoxyParams}
  107. \begin{DoxySeeAlso}{See also}
  108. \hyperlink{classCXLHash_a66be2064e952a39f04c0a54d83d1c779}{CXLHash::MD5}\}, \{
  109. \hyperlink{classCXLHash_a1ca7a04dcc397e382e3a4ee5e0e1b9a1}{CXLHash::SHA1}\}, or \hyperlink{classCXLHash_aeeccfbe476a8ab58ea0c3382287ff0e9}{CXLHash\#CRC32}. Defaults to \{
  110. \hyperlink{classCXLHash_a1ca7a04dcc397e382e3a4ee5e0e1b9a1}{CXLHash::SHA1}\}.
  111. \end{DoxySeeAlso}
  112. \begin{DoxyParams}{Parameters}
  113. \item[{\em integer}]\$hashLength \mbox{[}optional\mbox{]} The length of the hash to return. Only applies if {\bfseries \$hashType} is not MD5, SH1, or CRC32. . Defaults to 32. \item[{\em boolean}]\$rawOutput \mbox{[}optional\mbox{]} If {\bfseries \$rawOutput} is true, then the hash digest is returned in raw binary format instead of ASCII. \end{DoxyParams}
  114. \begin{DoxyReturn}{Returns}
  115. string
  116. \end{DoxyReturn}
  117. Definition at line 109 of file CXLHash.php.
  118. \begin{DoxyCode}
  119. {
  120. $_value = ( null === $hashTarget ) ? self::generate( $hashLength ) : $hashTar
  121. get;
  122. switch ( $hashType )
  123. {
  124. case self::MD5:
  125. $_hash = md5( $_value, $rawOutput );
  126. break;
  127. case self::SHA1:
  128. $_hash = sha1( $_value, $rawOutput );
  129. break;
  130. case self::CRC32:
  131. $_hash = crc32( $_value );
  132. break;
  133. default:
  134. $_hash = hash( $hashType, $_value, $rawOutput );
  135. break;
  136. }
  137. return $_hash;
  138. }
  139. \end{DoxyCode}
  140. Here is the caller graph for this function:\nopagebreak
  141. \begin{figure}[H]
  142. \begin{center}
  143. \leavevmode
  144. \includegraphics[width=400pt]{classCXLHash_ace936368fcb6b1d6d533c4d19cf7e596_icgraph}
  145. \end{center}
  146. \end{figure}
  147. \subsection{Field Documentation}
  148. \hypertarget{classCXLHash_a4ccb145eb796f708b107b1ed4069bd0f}{
  149. \index{CXLHash@{CXLHash}!\$\_\-hashSeeds@{\$\_\-hashSeeds}}
  150. \index{\$\_\-hashSeeds@{\$\_\-hashSeeds}!CXLHash@{CXLHash}}
  151. \subsubsection[{\$\_\-hashSeeds}]{\setlength{\rightskip}{0pt plus 5cm}\$\_\-hashSeeds\hspace{0.3cm}{\ttfamily \mbox{[}static, protected\mbox{]}}}}
  152. \label{classCXLHash_a4ccb145eb796f708b107b1ed4069bd0f}
  153. {\bfseries Initial value:}
  154. \begin{DoxyCode}
  155. array(
  156. self::ALL => array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l
  157. ', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B'
  158. , 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
  159. 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7',
  160. '8', '9' ),
  161. self::ALPHA_LOWER => array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
  162. 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' )
  163. ,
  164. self::ALPHA_UPPER => array( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
  165. 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' )
  166. ,
  167. self::ALPHA => array( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
  168. 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', '
  169. b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r
  170. ', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ),
  171. self::ALPHA_NUMERIC => array( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J
  172. ', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
  173. , 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
  174. 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
  175. '6', '7', '8', '9' ),
  176. self::ALPHA_LOWER_NUMERIC => array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', '
  177. i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y
  178. ', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ),
  179. self::NUMERIC => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ),
  180. self::ALPHA_LOWER_NUMERIC_IDIOTPROOF => array( 'a', 'b', 'c', 'd', 'e', 'f',
  181. 'g', 'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', '
  182. z', '2', '3', '4', '5', '6', '7', '8', '9' ),
  183. )
  184. \end{DoxyCode}
  185. Definition at line 66 of file CXLHash.php.
  186. \hypertarget{classCXLHash_ab56e734000051e5c12c8c5cf6d8d160d}{
  187. \index{CXLHash@{CXLHash}!ALL@{ALL}}
  188. \index{ALL@{ALL}!CXLHash@{CXLHash}}
  189. \subsubsection[{ALL}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ALL} = 0}}
  190. \label{classCXLHash_ab56e734000051e5c12c8c5cf6d8d160d}
  191. Our hash types
  192. Definition at line 39 of file CXLHash.php.
  193. \hypertarget{classCXLHash_a6bb7987358cd3de8e7c775094597e631}{
  194. \index{CXLHash@{CXLHash}!ALPHA@{ALPHA}}
  195. \index{ALPHA@{ALPHA}!CXLHash@{CXLHash}}
  196. \subsubsection[{ALPHA}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ALPHA} = 3}}
  197. \label{classCXLHash_a6bb7987358cd3de8e7c775094597e631}
  198. Definition at line 42 of file CXLHash.php.
  199. \hypertarget{classCXLHash_a33fc57236d932860ab0ad8e8268e0c99}{
  200. \index{CXLHash@{CXLHash}!ALPHA\_\-LOWER@{ALPHA\_\-LOWER}}
  201. \index{ALPHA\_\-LOWER@{ALPHA\_\-LOWER}!CXLHash@{CXLHash}}
  202. \subsubsection[{ALPHA\_\-LOWER}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ALPHA\_\-LOWER} = 1}}
  203. \label{classCXLHash_a33fc57236d932860ab0ad8e8268e0c99}
  204. Definition at line 40 of file CXLHash.php.
  205. \hypertarget{classCXLHash_a371814049e51cde466af6295bdfed4e3}{
  206. \index{CXLHash@{CXLHash}!ALPHA\_\-LOWER\_\-NUMERIC@{ALPHA\_\-LOWER\_\-NUMERIC}}
  207. \index{ALPHA\_\-LOWER\_\-NUMERIC@{ALPHA\_\-LOWER\_\-NUMERIC}!CXLHash@{CXLHash}}
  208. \subsubsection[{ALPHA\_\-LOWER\_\-NUMERIC}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ALPHA\_\-LOWER\_\-NUMERIC} = 5}}
  209. \label{classCXLHash_a371814049e51cde466af6295bdfed4e3}
  210. Definition at line 44 of file CXLHash.php.
  211. \hypertarget{classCXLHash_aa15c0932a4cd96ab710478faace6ccb9}{
  212. \index{CXLHash@{CXLHash}!ALPHA\_\-LOWER\_\-NUMERIC\_\-IDIOTPROOF@{ALPHA\_\-LOWER\_\-NUMERIC\_\-IDIOTPROOF}}
  213. \index{ALPHA\_\-LOWER\_\-NUMERIC\_\-IDIOTPROOF@{ALPHA\_\-LOWER\_\-NUMERIC\_\-IDIOTPROOF}!CXLHash@{CXLHash}}
  214. \subsubsection[{ALPHA\_\-LOWER\_\-NUMERIC\_\-IDIOTPROOF}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ALPHA\_\-LOWER\_\-NUMERIC\_\-IDIOTPROOF} = 7}}
  215. \label{classCXLHash_aa15c0932a4cd96ab710478faace6ccb9}
  216. Definition at line 46 of file CXLHash.php.
  217. \hypertarget{classCXLHash_a1acce0cfa5c3723599af4c7e325b4312}{
  218. \index{CXLHash@{CXLHash}!ALPHA\_\-NUMERIC@{ALPHA\_\-NUMERIC}}
  219. \index{ALPHA\_\-NUMERIC@{ALPHA\_\-NUMERIC}!CXLHash@{CXLHash}}
  220. \subsubsection[{ALPHA\_\-NUMERIC}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ALPHA\_\-NUMERIC} = 4}}
  221. \label{classCXLHash_a1acce0cfa5c3723599af4c7e325b4312}
  222. Definition at line 43 of file CXLHash.php.
  223. \hypertarget{classCXLHash_a13afa6f8ce77da9bd4a5af5d473d0d8b}{
  224. \index{CXLHash@{CXLHash}!ALPHA\_\-UPPER@{ALPHA\_\-UPPER}}
  225. \index{ALPHA\_\-UPPER@{ALPHA\_\-UPPER}!CXLHash@{CXLHash}}
  226. \subsubsection[{ALPHA\_\-UPPER}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf ALPHA\_\-UPPER} = 2}}
  227. \label{classCXLHash_a13afa6f8ce77da9bd4a5af5d473d0d8b}
  228. Definition at line 41 of file CXLHash.php.
  229. \hypertarget{classCXLHash_aa607ab5e557e6ebb60b85c5a20ad067f}{
  230. \index{CXLHash@{CXLHash}!CLASS\_\-LOG\_\-TAG@{CLASS\_\-LOG\_\-TAG}}
  231. \index{CLASS\_\-LOG\_\-TAG@{CLASS\_\-LOG\_\-TAG}!CXLHash@{CXLHash}}
  232. \subsubsection[{CLASS\_\-LOG\_\-TAG}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf CLASS\_\-LOG\_\-TAG} = 'yiixl.core.components.CXLHash'}}
  233. \label{classCXLHash_aa607ab5e557e6ebb60b85c5a20ad067f}
  234. Our logging tag
  235. Definition at line 29 of file CXLHash.php.
  236. \hypertarget{classCXLHash_aeeccfbe476a8ab58ea0c3382287ff0e9}{
  237. \index{CXLHash@{CXLHash}!CRC32@{CRC32}}
  238. \index{CRC32@{CRC32}!CXLHash@{CXLHash}}
  239. \subsubsection[{CRC32}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf CRC32} = 18}}
  240. \label{classCXLHash_aeeccfbe476a8ab58ea0c3382287ff0e9}
  241. Definition at line 55 of file CXLHash.php.
  242. \hypertarget{classCXLHash_a66be2064e952a39f04c0a54d83d1c779}{
  243. \index{CXLHash@{CXLHash}!MD5@{MD5}}
  244. \index{MD5@{MD5}!CXLHash@{CXLHash}}
  245. \subsubsection[{MD5}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf MD5} = 1}}
  246. \label{classCXLHash_a66be2064e952a39f04c0a54d83d1c779}
  247. Hashing methods
  248. Definition at line 53 of file CXLHash.php.
  249. \hypertarget{classCXLHash_a19cabff2391d99103d1bf11b0ed2972e}{
  250. \index{CXLHash@{CXLHash}!NUMERIC@{NUMERIC}}
  251. \index{NUMERIC@{NUMERIC}!CXLHash@{CXLHash}}
  252. \subsubsection[{NUMERIC}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf NUMERIC} = 6}}
  253. \label{classCXLHash_a19cabff2391d99103d1bf11b0ed2972e}
  254. Definition at line 45 of file CXLHash.php.
  255. \hypertarget{classCXLHash_a1ca7a04dcc397e382e3a4ee5e0e1b9a1}{
  256. \index{CXLHash@{CXLHash}!SHA1@{SHA1}}
  257. \index{SHA1@{SHA1}!CXLHash@{CXLHash}}
  258. \subsubsection[{SHA1}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf SHA1} = 2}}
  259. \label{classCXLHash_a1ca7a04dcc397e382e3a4ee5e0e1b9a1}
  260. Definition at line 54 of file CXLHash.php.
  261. The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
  262. \item
  263. \hyperlink{CXLHash_8php}{CXLHash.php}\end{DoxyCompactItemize}