diff --git a/reserver/util.py b/reserver/util.py new file mode 100644 index 0000000..d7b8199 --- /dev/null +++ b/reserver/util.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +"""Utility functions.""" + +from platform import system +from hashlib import sha256 +from time import time + +def is_platform_linux(): + """ + Check whether current platform is linux or not. + + :return: bool + """ + return system() == "Linux" + +def get_random_name(): + """ + Generate a random str based on current timestamp. + + :return: str + """ + return sha256(str(time()).encode("utf-8")).hexdigest() \ No newline at end of file