password-hash


Correct password_hash using


I am trying to make my own user-authorization php-script to login users which where created by other php-class (not mine).
So, I try to make hash-string from word admin to make it:
$2y$10$trJyrB8x2V/hKKeKJvNF0Otz6OqFgisd0fiLc7B1ssHzSvpE0ADYu
My PHP version is 5.4.4. And I am trying to code it like this:
echo (password_hash("admin", PASSWORD_DEFAULT));
but it outputs nothing.
I found this code in the third-party php-class:
public function make($value, array $options = array())
{
$cost = isset($options['rounds']) ? $options['rounds'] : $this->rounds;
$hash = password_hash($value, PASSWORD_BCRYPT, array('cost' => $cost));
if ($hash === false) {
throw new \RuntimeException("Bcrypt hashing not supported.");
}
return $hash;
}
Does anybody know how to use password_hash correctly?
Your options array probably creates a problem try this:
$hash = password_hash($value, PASSWORD_BCRYPT, ['cost' => $cost]);

Related Links

Adonis JS - Hashing Password
Correct password_hash using

Categories

HOME
python-2.7
mpdf
antd
message-queue
embedded-resource
docker-cloud
google-play-services
flurry
tibco
mithril.js
minecraft
lda
csrf
business-intelligence
bootstrap-switch
orc
spring-amqp
jquery-select2-4
angular4
multi-step
corona
temperature
google-cloud-logging
rpmbuild
node-webkit
azure-machine-learning
pst
batch-rename
sipp
jpa-2.1
data-collection
unrar
sap-lumira
tortoisehg
ccavenue
php-5.3
laravel-4.2
bitbake
basic-authentication
toad
series
john-the-ripper
seafile-server
android-collapsingtoolbar
ms-dos
extbase
export-to-pdf
swfupload
utf
python-jira
opal-framework
yoast
apache-toree
linq-to-excel
intellij-lombok-plugin
cyanogenmod
cordova-ios
redisson
simple-schema
nivo-slider
portability
connect-direct
network-protocols
.when
dynamics-crm-4
emf-compare
metabase
tablespace
nsrunloop
p6spy
django-testing
eclemma
swiffy
polymerfire
management-studio-express
wif4.5
diawi
juniper-network-connect
self
lowercase
highest
espresso
gql
uitest
dynamics-ax-2012-r2
android-handler
wicked-gem
fuseesb
mathematical-expressions
sql-processor
smacss
accessory
csslint
xulrunner
nodeload
jack
cpu-time
principalcontext
strcmp
objective-c-runtime
arel
semantic-merge
websphere-6.1
platform-independent
nsfont
sigar
cewolf
fragment-identifier
bass
android-2.1-eclair
chunking
jdownloader
android-input-method
data-retrieval
eai
twitter-feed
levels

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App