Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def base_enc_str(s: str, base=52) -> int:
- """base_enc_str
- will take a string and attempt to encode the string as base 52 number by
- default.
- :param s:
- :type s: str
- :param base:
- :rtype: int
- """
- return (
- (np.array(list(bytes(s, encoding="utf-8"))) - 64)
- * (base ** np.arange(len(s) - 1, -1, -1))
- ).sum()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement