Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
c5ddb67d
Commit
c5ddb67d
authored
Jul 08, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comment to hash class.
parent
6d296f2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
hash.php
system/hash.php
+8
-2
No files found.
system/hash.php
View file @
c5ddb67d
...
@@ -17,7 +17,11 @@ class Hash {
...
@@ -17,7 +17,11 @@ class Hash {
public
$salt
;
public
$salt
;
/**
/**
* Create a new hash instance.
* Create a new salted hash instance.
*
* If no salt is provided, a random, 16 character salt will be generated
* to created the salted, hashed value. If a salt is provided, that salt
* will be used when hashing the value.
*
*
* @param string $value
* @param string $value
* @param string $salt
* @param string $salt
...
@@ -25,7 +29,9 @@ class Hash {
...
@@ -25,7 +29,9 @@ class Hash {
*/
*/
public
function
__construct
(
$value
,
$salt
=
null
)
public
function
__construct
(
$value
,
$salt
=
null
)
{
{
$this
->
value
=
sha1
(
$value
.
$this
->
salt
=
(
is_null
(
$salt
))
?
Str
::
random
(
16
)
:
$salt
);
$this
->
salt
=
(
is_null
(
$salt
))
?
Str
::
random
(
16
)
:
$salt
;
$this
->
value
=
sha1
(
$value
.
$this
->
salt
);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment