mirror of
https://github.com/namibia/awesome-cheatsheets.git
synced 2024-12-22 01:58:54 +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.
|
||||
|
||||
/********************************************************************************************
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user