3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class passwordHash { // blowfish private static $algo = '$2a'; // cost parameter private static $cost = '$10'; // mainly for internal use public static function unique_salt() { return substr(sha1(mt_rand()), 0, 22); } // this will be used to generate a hash public static function hash($password) { return crypt($password, self::$algo . self::$cost . '$' . self::unique_salt()); } // this will be used to compare a password against a hash public static function check_password($hash, $password) { $full_salt = substr($hash, 0, 29); $new_hash = crypt($password, $full_salt); return ($hash == $new_hash); } } $pw = 'test'; print( passwordHash::hash($pw) );
based on nTE1n
Output for 7.2.0
$2a$10$2ce67254c48cf282d69e3uuK7vGSvG.erJbllsZwYpyNIJil2hegq
Output for 7.1.7
$2a$10$7bbde5c61888fd63e7664O7amcYBddz6MoiRyQ/.WRuPAEq/m8yJG
Output for 7.1.6
$2a$10$f375200139623458878a9utyUPXS2PhE2qg0FMIVgltARA9.SrbKu
Output for 7.1.5
$2a$10$a1f22b6de30614f8fe9d1utoUhgR.ckHBqavgpq/MuPZ5Tq1nPpLy
Output for 7.1.0
$2a$10$b7f035b716c864fb054e8OTuWQyMYMZCHLOdTP.CU4CUL0l.RClyK
Output for 7.0.20
$2a$10$7dcf9f6b7a6c159216015O5xVq34wbpQ02Sz8vdY2viUnhEYGzY1.
Output for 7.0.6
$2a$10$07b5d03b85e0140ec9775O0j1VCMDFlPQjrcJsy3hw9YhkfPEbFl6
Output for 7.0.5
$2a$10$dd30e8477670d0c3b76d4eCgGqLT9jVOqzoXHhAwDZf.vYTYrUbvy
Output for 7.0.4
$2a$10$2423695dfa6dfeb2c97d3u4P7cgqjYgdPdvKbIvOxoRLwmnm93.bK
Output for 7.0.3
$2a$10$a9fe1c94af196868960e2eoJ8JPwI8ERFzVmZ3NrAmG5d5NN1z0JW
Output for 7.0.2
$2a$10$0314ad3eb61d633df0f00e3d7aYRnRveI4IpRCUCAEwWMRXXVS18C
Output for 7.0.1
$2a$10$9d05f156212bbda513763u7uh6dECwisQVpVIkJhpCXleZ2k0zPJu
Output for 7.0.0
$2a$10$dae07d0844aaaeadbec00eNdkKR5H9EjLvBHIuiIJjKsREY2.Tq4e
Output for 5.6.28
$2a$10$a251532b031c52e3946a7uJP550yZA/1m6uyoR83D19zm1WY7RAca
Output for 5.6.21
$2a$10$93e29de56611a26ce1a7eOkfSA2gBmuHZApgbFg6elwzMGSPscpZy
Output for 5.6.20
$2a$10$8e188e83c7176ce72a9c9udCHkQ2uIDL3.h0.uY3OGffQeBOsXCxW
Output for 5.6.19
$2a$10$43e1e47b50ba6cf7abd4buYXRdwj73zM8c2HdjjgWCre9DOC16/8m
Output for 5.6.18
$2a$10$16e298d15730770f28eb3eEYVlcOFdCeSWAtnwH/rAe.fiEP/wqRW
Output for 5.6.17
$2a$10$b5aac919f155e21bd4519uJWWHL1ELQhjX5KdPYWXIRRuWDc.K.LW
Output for 5.6.16
$2a$10$0157a86fa1ea35e81b573uOiVtn3cV128a.UYl792.S.1TkJtZREG
Output for 5.6.15
$2a$10$565e6d0799bfcf11d5f43uxhzT4HxR2pt/4U1Wf.1aIOLLuZ8KV/S
Output for 5.6.14
$2a$10$c9bee857a8a55ce337019uIHvbYoqCzyBvL6PvXhfN2cBf2GPE8g2
Output for 5.6.13
$2a$10$ec96291adb01e49b78c18eKoSiDFb31tJSL6Vud2uvydK9apPzwOm
Output for 5.6.12
$2a$10$82337affc38f460c4c4e8emhzl25X4gJqj8CSFNMDcHn607NzyAjC
Output for 5.6.11
$2a$10$cdbe84e49c9193f47382feNO332c51jVsY2GQPjLiNZfhLHFaoSkS
Output for 5.6.10
$2a$10$85279be6a4e23c4c51980u9JzAJQcR9QLVRenroRR94u3DmR8n7Qi
Output for 5.6.9
$2a$10$9254643696d8a9fb015c3uH7rdyMnJqrdLTij0ljwlozoiINUk4nm
Output for 5.6.8
$2a$10$eab2a44108383411bb30euhPda3rXac0t0l.N.pIoVDbpABvvz8Cq
Output for 5.5.35
$2a$10$f62e7792ebf672c57068fON6DoJE6t8mmfPX.XisWz4/GMo3d9GTa
Output for 5.5.34
$2a$10$50e4040efa981f6b90c90u2XV6yWm0WtE2SMTpr38TMo1z4ydXmAG
Output for 5.5.33
$2a$10$490b08d33a2acb9be9a1auTcvhwQw8HSlhmAKLLiMjc.BJP0jOVju
Output for 5.5.32
$2a$10$ea892195a8ad42d42dee9uj2PCw24r3TbYQJ5GcqVMxEVIhQ4NjOq
Output for 5.5.31
$2a$10$262619f15230051c085a7uR4Y1u0DsX75ZoAP.olVWJrWrONk41ky
Output for 5.5.30
$2a$10$b83d059c6c54c60b918f5OROpXRpBUXXVTZIFKkNhI4as5fjXzRga
Output for 5.5.29
$2a$10$24af9d9658c415bdbebe0OKwgnsahKG1Zaav78ZLsRjf2sr5iCZU.
Output for 5.5.28
$2a$10$63ab7cc72d3fa59fd4e49uFnV1oDyRV/j5VBQQ5b8P8jMbnTBv8Dq
Output for 5.5.27
$2a$10$c5ad1fbf1eff078c4141aurGbbzSD8P3hl73ITHeax5K4wJlOJ5kS
Output for 5.5.26
$2a$10$0781e4a41459546f1cdb9umAHEdnM5iRSC.kntLcuZmmOa6FWhNoq
Output for 5.5.25
$2a$10$1924d10465bef741a53e0eP35FbG07CrVEADzsE38fAttsKVjYCEi
Output for 5.5.24
$2a$10$d21eb9082a78feae3d2a9uAO.r4b4C78sD9KuI5OoD5cFstaVnpUq
Output for 5.4.45
$2a$10$6b5e800e89984f145e3aeOyvorf0UBN/muOqtFw..05b6vi6bZK3i
Output for 5.4.44
$2a$10$0c57898ec796ffb0850f7ucHLVbsdYs50a6Kkv.foYjhdcM8rkTgO
Output for 5.4.43
$2a$10$81ee42bf1d9e512d13c35uk77OZQAKhS3z6zdM8eJZek0Z1bfj.Bm
Output for 5.4.42
$2a$10$9b4376e93ed073e0ac4bcuVQpvUW6Vng5mU35c4Z/a2yVO5TeRSM.
Output for 5.4.41
$2a$10$108e9ccf0d923fb29988eu92CP3.VOK0.35d6BCfGs0nMrnkVJ7jO
Output for 5.4.40
$2a$10$735ec83279ee9c16fa5eeOHHLrtPg9Nj2DLHbPFsrFpRHOKAdxwMK
Output for 5.4.39
$2a$10$157d6f93bf9584ed46027uM6G4/j3LnCWJ/8VvKQ4BAD/B3mfQRny
Output for 5.4.38
$2a$10$000f5892f0ef40bee6b82uiRSfXJPGnKaImbCCifOFE8n.owrwCtC
Output for 5.4.37
$2a$10$2c0da13c6f93740dbfe42uoWjXW5Ts3aYVBGSZPiNziapy4r5ytS.
Output for 5.4.36
$2a$10$b856cbf1212c99dc86658urvpQTdIN7v4Bh.LWOR1UD38LMue0AgW
Output for 5.4.35
$2a$10$17f9097ba30dcb7740b0eu0/yKlR82aka8GS.8WI8DDxwrPm/hiv6
Output for 5.4.34
$2a$10$125b442f3cbecbcaf6fdaui2VpV2NQ6RoKeBeeWL6LP4kFvb50pR6
Output for 5.4.32
$2a$10$8bc23e9d22593a6753e8fu5CyVa0QoztKkB9r1GodM.F/CxdQxAiC
Output for 5.4.31
$2a$10$116c67f01c3f723642702euIxCB0s4Pxd6.AdeMnNHkNoNdShPTC2
Output for 5.4.30
$2a$10$263b18766aafa5e11f461ORk1lEOfgnoQzT9LwBQBGC9OG2vKR1y.
Output for 5.4.29
$2a$10$ceedab18b2baf0a4d7706uMaSzk6L8dEaGUgcpm8yuTzjnglkQqmC
Output for 5.4.28
$2a$10$a386278eebe54a0875720uf4FMUwhlBiQJIaT0kkxzjGT1JhiBAnq
Output for 5.4.27
$2a$10$5ccefcdc76df5af6f5babuIPFef2mh1Eag5Hcz5i2AOFVcYnmL7Te
Output for 5.4.26
$2a$10$b24da5c6a6f41d7eaa7e2OpCoGtVZaAirj2R.LhPwtrL7ZJ6cgHcG
Output for 5.4.25
$2a$10$08d2e70ad0e53b42f88fcu/G8KGgdwd3x/VCznBMohwH7AJZvqT3q
Output for 5.4.24
$2a$10$73c4edfa4d884d84b4372uAKeA6nRPf5CUOo1UeCHDnL9eJ6C7thG
Output for 5.4.23
$2a$10$36d617b8f4f416b2976eaulilRPzMYNdqA.GBFRNTlE3hi0uS/NUu
Output for 5.4.22
$2a$10$e31f34e4708f48ba4cc13usYxVoIPRptSuuw8vCAjz9ZRUi2lLfii
Output for 5.4.21
$2a$10$73af0f25186871acc2498eL.NEeIf4VNWx7gz8dVyqLeOrGxvgq.y
Output for 5.4.20
$2a$10$366283b654faf1a2b2e36OQ7b1fCDmkP/DFvxPcxCMZAW.lmEdpUa
Output for 5.4.19
$2a$10$a9dec2cf9241f3672e787udlf5Vrj7k/vBAgToNKT93rCUm4oXIp6
Output for 5.4.18
$2a$10$86350da1648d70845ac97u4bRAMpyOH.l4.LVWm7ldTK.BnMBfgU6
Output for 5.4.17
$2a$10$e9dcfafe961ab84b5af9cuGbH6l/BO92LWESvoCVKZAbfWBcLhaUe
Output for 5.4.16
$2a$10$1a374b2f662c9e57553ceuDebP7X3OCZn5adGyhy5tQRADSzELnAS
Output for 5.4.15
$2a$10$c8dbdc61acb8cc8d9370deErQz7GsAIQWq.8GT4cSKC/hx4c.Z0Z2
Output for 5.4.14
$2a$10$0cd39019cad13900c7d82uLTwzrEmn.cmL/WDLWXPiZM1wRO4eNLG
Output for 5.4.13
$2a$10$b0c105fa6432c294ad4b5ueMA6scSKKwvZfSU8ibVZvCk5MDFsZjy
Output for 5.4.12
$2a$10$a87a159aa71552c9d52a0e5T2K2w1FBY8VfEorSxAGNXribEYEnqq
Output for 5.4.11
$2a$10$01009e95b120f524c988beuuuIWypF4s.wYx7YFr1K.PltV1ZZrFu
Output for 5.4.10
$2a$10$5bb56e6548bf5d05e64f8uzVfV9iiy/8RrlGuzww2wz.Z90Sojr.e
Output for 5.4.9
$2a$10$08c0fd9078cb626cfcd24umVovMLTJFIXhYugmtEeGnocHZc5EXPe
Output for 5.4.8
$2a$10$4f1c70c4f1b7fff1a78beO9rOsjsLHWFOiLQo.G8KvRNU/VNvHyXm
Output for 5.4.7
$2a$10$4894432090507ce4486cfu.Z1VN8m9r6jY7Q3zkEE0Yx4WtbtrZhW
Output for 5.4.6
$2a$10$68197e690685889c057f6OUzthdnH1ZIEJGQFxPh1oxloQP7rpS8a
Output for 5.4.5
$2a$10$4e4b0e862360b6de954c6unn1k8YA33R9Fc1/VraB8fOYd.haVN.2
Output for 5.4.4
$2a$10$41e2b3c63464910531993u7uDu6GCOqDA5nC/CnVcmLjQkgzV7QP.
Output for 5.4.3
$2a$10$2a8dad3af878c3b8e7045uUA.MvHc75nHVdCO9P0z9J1bpHMt/.Ge
Output for 5.4.2
$2a$10$bc69955ede923483f1030u4xUbYIAczOSYHDBaWMpNX6Clv01o/7u
Output for 5.4.1
$2a$10$c5b7990d05b7a14fdbc41eDgHVcXEGSyd3eFFvFhp3OYDmdwFkQNa
Output for 5.4.0
$2a$10$ed3e05f58f02df58c9ba7Oy0iaceMQGUpcSJqVybFKsdrO9lDeSQK
Output for 5.3.29
$2a$10$5205a47a0d3dc83cb14efOiY8pW76GeaFknOn4p7PwyYDSaxj1npK
Output for 5.3.28
$2a$10$219bc63630a8aefba49e6uQ88KF64oavKg2P.Gm1VL739kcVwWUFu
Output for 5.3.27
$2a$10$d4000128f4cd2a8054ebcOTeWEgGciZ5WEzz0GcNq0PuJb1wrikIi
Output for 5.3.26
$2a$10$fbe385dcc99bc5686386buJH51Jz6U50EqFuRVFICasRdQzgH4OEO
Output for 5.3.25
$2a$10$83659107e678e96c7ff0dOxYPfe2DuXt/lwaxNqLJVTQMldJB0Bki
Output for 5.3.24
$2a$10$4434d3249eb7cff948d45ulD9RQ3wUMbEnjUeRA4R7runM61h/QQG
Output for 5.3.23
$2a$10$64c48c8a95069758cd91furrjfLq6TE2pHIzoFIDkcdZyFnlLekkO
Output for 5.3.22
$2a$10$543374e6d60e01c435588OdK2mO975xAsMOEq8tanyl0lguZu9lDe
Output for 5.3.21
$2a$10$e4701865e30e6d27a72c0eZvf5YODl21k8WJ3ZuqZ5ILXkCy3k6Ji
Output for 5.3.20
$2a$10$fbc675b37c33829481644u1.84zbABkunVGJ90E/T63zZ2Yq1lM36
Output for 5.3.19
$2a$10$0a0832991f8f4201d6f78eX9hpLTeckZ0Y802PNqxmCtOkq4/yiei
Output for 5.3.18
$2a$10$9db73500cb44709e81240OtbNC4Josy7MkQRGnpvyR/nN6THhAa3i
Output for 5.3.17
$2a$10$51d5ca551c801598a668beHthuFS2K5LrpormsaFzJLFt6hyxXuem
Output for 5.3.16
$2a$10$c663bc94e08b494d94c11uteYX4cp0JN6H9ekL1D22FYzUY1IWWN2
Output for 5.3.15
$2a$10$1fc609c86df0bf581f926ugrZnjJKpBLrynH0ET0cL5E2IpflxlUO
Output for 5.3.14
$2a$10$5f78d245fb70a62938f7aOtnQ4B/8WEIl9aiD1II9sx0iFGWxek0y
Output for 5.3.13
$2a$10$74fa4978a0390fe838966OVM91tb1/GFihZ7oIaGYlUCLnLgVB2Fq
Output for 5.3.12
$2a$10$1b105b6e3e301f93c215auyxPV95lBlZBT2h4TmxErkbACjH0F6mG
Output for 5.3.11
$2a$10$01ecbfe5c124aa7332e4dOt1mLGpKiT2c02bNatSuL2JlTn.6jmFa
Output for 5.3.10
$2a$10$7adbcadb6486b65c91141uB6pbz6f7QhhWVZloedBgMBrJ9859bD6
Output for 5.3.9
$2a$10$57f893abf6b944285c770uT9X3qrIcx1wNM61DEQUsoVBjwaiGvY.
Output for 5.3.8
$2a$10$c505ba4cb886a078e26ccuILIClHmeMm8Wvb/RrkPtPPnDhVjI1rS
Output for 5.3.7
$2a$10$522046adecb48be722af8uzpZJxJu6XvrbYwKROerv7ROrHVs6h8e
Output for 5.3.6
$2a$10$115a3f2c0a4b3abdaa126ut2566potlB4GE.oqXdKSkNwWNpIVtsK
Output for 5.3.5
$2a$10$2004817a6c6bdf0c4c18euxfVKvq2JRKhVYIbWdaopIcsk99WZjji
Output for 5.3.4
$2a$10$8f6f5e1e9d809798f0e42uzHATPNEZvQFqMKoztlkt3VtZRtWikDC
Output for 5.3.3
$2a$10$56a0c90d53f56b080aaf0uWr86aK6erpL0Qmg0sgzrrKHiQVflKAy
Output for 5.3.2
$2a$10$6c4a6e912300a2de1e795ujY54msW5ZkprdYokM0eY4H1GUh1X2ju
Output for 5.3.1
$2a$10$d0076a4246ee813f78053Ojkyb020Np/tXWW8T8lXs/.WCGuSz45a
Output for 5.3.0
$2a$10$182aba3931398d3d04f93OYD7rOW79iQv.AWBQj0TSEIw3vEODxwm
Output for 5.0.0 - 5.2.17

Process exited with code 139.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/vddob on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/vddob on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/vddob on line 6
Process exited with code 255.