DEV Community

Discussion on: OTP verification without any Database

Collapse
 
ianmacartney profile image
Ian Macartney

I wrote some python and generated all hashes in under a second locally:

from hashlib import sha256
phone="+18001234567"
expiry= challenge.split(".")[1]
start = time.time();
for i in range(999999):
    sha256(f"{phone}{i:06d}{expiry}".encode('utf-8'))
print(time.time() - start)
> 0.3987562656402588
Enter fullscreen mode Exit fullscreen mode