Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Photogram project PHP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raghav
Photogram project PHP
Commits
bc0641b5
Commit
bc0641b5
authored
1 week ago
by
Raghav
Browse files
Options
Downloads
Patches
Plain Diff
Tested with password functions
parent
e7cb71f4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
costtest.php
+14
-0
14 additions, 0 deletions
costtest.php
testhash.php
+13
-0
13 additions, 0 deletions
testhash.php
with
27 additions
and
0 deletions
costtest.php
0 → 100644
+
14
−
0
View file @
bc0641b5
<?php
// $time = microtime(true);
// $option = [
// 'cost' => 16,
// ];
// echo password_hash("password", PASSWORD_BCRYPT, $option);
// echo "\nTook ". microtime((true) - $time) . " sec";
if
(
password_verify
(
"raghav"
,
'$2y$10$AQDHj9ymPO7To2vNlKvQXedzO4a/3s0aL3sEuh22bS/OMfaRKjzWm'
))
{
echo
"Password correct"
;
}
else
{
echo
"Password Incorrect"
;
}
This diff is collapsed.
Click to expand it.
testhash.php
+
13
−
0
View file @
bc0641b5
...
...
@@ -10,3 +10,16 @@ raghav;
echo
"string length: "
.
strlen
(
$str
)
.
"
\n
"
;
echo
"md5: "
.
md5
(
$str
)
.
"(length: "
.
strlen
(
md5
(
$str
))
.
")
\n
"
;
echo
"base64: "
.
base64_encode
(
$str
)
.
"
\n
(Length: "
.
strlen
(
base64_encode
(
$str
))
.
")"
;
// Testing type of hashing in php
$data
=
"hello"
;
foreach
(
hash_algos
()
as
$v
)
{
$r
=
hash
(
$v
,
$data
,
false
);
printf
(
"%-12s %3d %s
\n
"
,
$v
,
strlen
(
$r
),
$r
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment