mirror of
https://github.com/namibia/awesome-cheatsheets.git
synced 2025-04-11 08:11:51 +00:00
docs(adonis): encryption and hashing
This commit is contained in:
parent
35039d583f
commit
e69c95694e
@ -301,6 +301,21 @@ Logger.debug(msg[, …data]) // Print a debug log (level 7).
|
|||||||
|
|
||||||
Logger.transport(transport) // Switch transport on the fly.
|
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
|
* SESSIONS
|
||||||
* https://adonisjs.com/docs/sessions
|
* https://adonisjs.com/docs/sessions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user