Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 109507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:04:49+00:00 2026-05-11T02:04:49+00:00

I think this must be a stupid question, but why do the results of

  • 0

I think this must be a stupid question, but why do the results of urlsafe_b64encode() always end with a ‘=’ for me? ‘=’ isn’t url safe?

from random import getrandbits from base64 import urlsafe_b64encode from hashlib import sha256 from time import sleep  def genKey():    keyLenBits = 64    a = str(getrandbits(keyLenBits))    b = urlsafe_b64encode(sha256(a).digest())    print b  while 1:    genKey()    sleep(1) 

output :

DxFOVxWvvzGdOSh2ARkK-2XPXNavnpiCkD6RuKLffvA= xvA99ZLBrLvtf9-k0-YUFcLsiKl8Q8KmkD7ahIqPZ5Y= jYbNK7j62KCBA5gnoiSpM2AGOPxmyQTIJIl_wWdOwoY= CPIKkXPfIX4bd8lQtUj1dYG3ZOBxmZTMkVpmR7Uvu4s= HlTs0tBW805gaxfMrq3OPOa6Crg7MsLSLnqe-eX0JEA= FKRu0ePZEppHsvACWYssL1b2uZhjy9UU5LI8sWIqHe8= aY_kVaT8kjB4RRfp3S6xG2vJaL0vAwQPifsBcN1LYvo= 6Us3XsewqnEcovMb5EEPtf4Fp4ucWfjPVso-UkRuaRc= _vAI943yOWs3t2F6suUGy47LJjQsgi_XLiMKhYZnm9M= CcUSXVqPNT_eb8VXasFXhvNosPOWQQWjGlipQp_68aY= 
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:04:50+00:00Added an answer on May 11, 2026 at 2:04 am

    Base64 uses ‘=’ for padding. Your string bit length isn’t divisible by 24, so it’s padded with ‘=’. By the way, ‘=’ should be URL safe as it’s often used for parameters in URLs.

    See this discussion, too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This must be a very stupid newbie question, but I have spent my whole
I think this could be a very easy question for you. But I have
(I think this is a pretty basic question on OOP, but unfortunately I wasn't
I think this question has been asked many a times but I've been searching
This probably sounds like a stupid question, but I'm going to give it a
this is a really stupid question but I have a deadline and I'm very
This must be a ridiculously stupid question, because after numerous searches of the StackOverflow
I feel stupid asking this question, but I can not find a clear answer
I think this must be an easy question for somebody who uses bitmap in
This is probably a really stupid MSBuild question but if I have <ItemGroup> <Dll

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.