Sale Djenic 2be8bb55ee refactor: privacy methods added
- methods `changeDatabasePassword` and `getLinkPreviewWhitelist` added
to `privacy.nim`
- `hashPassword` moved to `utils.nim` since it's used from multiple paces
- `getEthAccounts` added to `eth.nim`
- `verifyAccountPassword` method updated so it returns `RpcResponse` now
2022-02-01 11:12:54 +01:00

12 lines
350 B
Nim

import nimcrypto
proc isWakuEnabled(): bool =
true # TODO:
proc prefix*(methodName: string, isExt:bool = true): string =
result = if isWakuEnabled(): "waku" else: "shh"
result = result & (if isExt: "ext_" else: "_")
result = result & methodName
proc hashPassword*(password: string): string =
result = "0x" & $keccak_256.digest(password)