Enabled bcrypt on Linux. Closes #25.

This commit is contained in:
Dominik Picheta 2014-12-07 18:07:05 +00:00
commit bf80d4bf73
2 changed files with 9 additions and 2 deletions

View file

@ -9,6 +9,10 @@
import
os, strutils, times, md5, strtabs, cgi, math, db_sqlite, matchers,
rst, rstgen, captchas, scgi, jester, asyncdispatch, asyncnet, cache, sequtils
when not defined(windows):
import bcrypt # TODO
from htmlgen import tr, th, td, span
const
@ -221,7 +225,10 @@ proc makeSalt(): string =
proc makePassword(password, salt: string): string =
## Creates an MD5 hash by combining password and salt.
result = getMD5(salt & getMD5(password))
when defined(windows):
result = getMD5(salt & getMD5(password))
else:
result = hash(getMD5(salt & getMD5(password)))
# -----------------------------------------------------------------------------
template `||`(x: expr): expr = (if not isNil(x): x else: "")

View file

@ -8,4 +8,4 @@ license = "MIT"
bin = "forum"
[Deps]
Requires: "nimrod >= 0.9.2, cairo#head, jester#head"
Requires: "nimrod >= 0.9.2, cairo#head, jester#head, bcrypt#head"