Guest User

Untitled

a guest
Dec 20th, 2020
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. function _0xe35c(d, e, f) {
  2.  
  3. var g = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/".split("");
  4. var h = g.slice(0, e);
  5. var i = g.slice(0, f);
  6. var j = d.split("").reverse().reduce(function (a, b, c) {
  7. if (h.indexOf(b) !== -1) return a += h.indexOf(b) * (Math.pow(e, c))
  8. }, 0);
  9. var k = "";
  10. while (j > 0) {
  11. k = i[j % f] + k;
  12. j = (j - (j % f)) / f
  13. }
  14. return k || "0"
  15. }
  16. var d = "57"
  17. var e = "8"
  18. var f = "10"
  19. document.write(_0xe35c(d, e, f))
  20.  
  21. ##################################################
  22. ### python
  23. ##################################################
  24. from functools import reduce
  25. d = '57'
  26. e = 8
  27. f = 10
  28. def _0xe35c(d, e, f) :
  29. g = list("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/")
  30. h = g[0:e]
  31. i = g[0:f]
  32. listd = list(d)[::-1]
  33. def red(a,b,c=0):
  34. indx = h.index(b)
  35. if indx!=-1:
  36. wyn = int(float(indx) *(math.pow(int(e),c)))
  37. a+=(wyn)
  38. return a
  39. j = reduce(red,listd,0)
  40. k = ''
  41. while j>0:
  42. k = i[j % f] + k
  43. j = (j - (j % f)) / f
  44. return k if k else "0"
  45. ax=_0xe35c(d, e, f)
  46.  
  47.  
  48.  
  49.  
Advertisement
Add Comment
Please, Sign In to add comment