]>
git.mar77i.info Git - hublib/blob - hub/utils.py
c9d955cfa107e1e6cc01f5d7a7ea1b3d1e9a23d1
1 from base64
import urlsafe_b64encode
2 from hashlib
import sha3_512
5 def scramble(secret
, value
):
7 h
.update(f
"{secret}{value}".encode())
8 return urlsafe_b64encode(h
.digest()).rstrip(b
"=").decode("ascii")
11 def get_redis_pass(redis_conf
):
12 prefix
= "requirepass "
13 with open(redis_conf
, "rt") as fh
:
15 if not line
.startswith(prefix
):
17 return line
[len(prefix
) :].rstrip()