Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.25 KB

helper.md

File metadata and controls

69 lines (53 loc) · 1.25 KB

Healper

back

Table of Contents

dd

dd() is essentially adding a break point in your code which dumps the properties of an object to your browser.
This proc is only available in develop mode.

API

proc dd(outputs:varges[string, `$`])

Example

var a = %*{
  "key1": "value1",
  "key2": "value2",
  "key3": "value3",
  "key4": "value4",
}
dd(a, "abc", request.repr)

dd

password

Basolato has its own useful password library. It uses bcrypt package inside.
https://github.com/runvnc/bcryptnim

API

proc genHashedPassword*(val:string):string =

proc isMatchPassword*(input, hashedPassword:string):bool =

Example

import basolato/password

let pass1 = "Password!"
let pass2 = "Password!"
let pass3 = "WrongPassword"
let hashed = genHashedPassword(pass1)

echo isMatchPassword(pass2, hashed)
>> true

echo isMatchPassword(pass3, hashed)
>> false