nimrod-code/nimforum — pull request #25 by flaviut (2014-05-23 20:25:29+00:00)
Title: Use Bcrypt and Babel

Babel is used to grab `cario`, `jester`, and `bcrypt`. Before this can be used, the following untested code must be run to update all the hashes to bcrypt:

``` nimrod
import db_sqlite, bcrypt

let connection: TDBConn = nil

const
getAll = sql"Select rowid, password, seed From person;"
replacePassword = sql"Replace Into person(rowid, password) values (?, ?)"

for row in connection.fastRows(getAll): # Only safe for SQLite
let newPassword = hash(row[1], row[2])
connection.exec(replacePassword, row[0], newPassword)
```