I'm a newbie in hashing and need to hash data I store in a JSON file for my Telegram bot. Is there a way to hash data such that when I restart my bot, I don't lose the data?

As long as I see in most of the hashing functions and documentations, the process uses random sequence generator, which surely has different seed when a program is restarted.

That means that when I run a program once, it will return some value for

oldhash = hash('a')

But after I restart a program, the function will return an other value for the same sequence

newhash = hash('a')

newhash is not equal to oldhash

What I expect is a function that can encode, retrieve and decipher data I store in a file no matter what happens to the program run (I also store data in file so that it doesn't disappear from dynamic memory after something happens to the program or server)

0 Answers