1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-12-22 10:08:54 +00:00

docs(adonis): encryption and hashing

This commit is contained in:
Julien Le Coupanec 2020-04-18 12:28:32 +02:00
parent 35039d583f
commit e69c95694e

View File

@ -301,6 +301,21 @@ Logger.debug(msg[, …data]) // Print a debug log (level 7).
Logger.transport(transport) // Switch transport on the fly.
/********************************************************************************************
* ENCRYPTION AND HASHING
* https://adonisjs.com/docs/4.1/encryption-and-hashing
********************************************************************************************/
const Encryption = use('Encryption')
Encryption.encrypt(string) // Encrypt a given value.
Encryption.decrypt(string) // Decrypt an encrypted value.
const Hash = use('Hash')
await Hash.make(string[, config]) // Hash a plain string value.
await Hash.verify(string, hashedString) // Since you cannot decrypt a hash, you can verify the user input against the previously hashed value.
/********************************************************************************************
* SESSIONS
* https://adonisjs.com/docs/sessions