Is there any direct way to assert valid sha1 ,valid epoch timestamp and valid positive integer in python.I am bound to use native python and no third party libs.
Asked
Active
Viewed 263 times
1
-
3Please explain your question further. What do you mean by "assert valid"? What is a "valid utc timestamp"? – fletom Feb 23 '15 at 23:45
-
A built-in (for python >=2.5) hashlib module provides sha1 calculation (https://docs.python.org/2/library/hashlib.html?highlight=sha1); epoch timestamp is in utc, isn't it? epoch ts is available in a built-in time module: time.time(). assert is a built-in expression. I don't see a need for any third-party library. – Mr. Girgitt Feb 23 '15 at 23:54
-
You can do all those things with python, see the hashlib and datetime modules. You need to explain more about the validation part. – Steven Kryskalla Feb 24 '15 at 00:03