From bc0641b5003857a334b317c4c555b0f92b966997 Mon Sep 17 00:00:00 2001
From: Raghav <raghavsmart1213@gmail.com>
Date: Wed, 19 Mar 2025 13:15:32 +0000
Subject: [PATCH] Tested with password functions

---
 costtest.php | 14 ++++++++++++++
 testhash.php | 13 +++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 costtest.php

diff --git a/costtest.php b/costtest.php
new file mode 100644
index 0000000..8f02fef
--- /dev/null
+++ b/costtest.php
@@ -0,0 +1,14 @@
+<?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";
+}
diff --git a/testhash.php b/testhash.php
index 4da2be3..100f65b 100644
--- a/testhash.php
+++ b/testhash.php
@@ -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);
+}
-- 
GitLab