freeCodeCamp/curriculum/challenges/arabic/06-information-security-and.../information-security-with-h.../hash-and-compare-passwords-...

951 B

id title challengeType videoUrl localeTitle
58a25bcff9fc0f352b528e7e Hash and Compare Passwords Synchronously 2

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'getUserInput => $.get(getUserInput("url")+ "/_api/server.js") .then(data => { assert.match(data, /START_SYNC[^]*hash.*=.*bcrypt.hashSync.*myPlaintextPassword( |),( |)saltRounds[^]*END_SYNC/gi, "You should call bcrypt.hashSync on myPlaintextPassword with saltRounds"); assert.match(data, /START_SYNC[^]*result.*=.*bcrypt.compareSync.*myPlaintextPassword( |),( |)hash[^]*END_SYNC/gi, "You should call bcrypt.compareSync on myPlaintextPassword with the hash generated in the last line"); }, xhr => { throw new Error(xhr.statusText); })'

Challenge Seed

Solution

// solution required