status-lib/status/statusgo_backend_new/utils.nim

13 lines
351 B
Nim
Raw Normal View History

2022-01-03 13:01:10 +00:00
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: "_")
2022-01-03 13:01:10 +00:00
result = result & methodName
proc hashPassword*(password: string): string =
result = "0x" & $keccak_256.digest(password)