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 5999313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:32:04+00:00 2026-05-23T00:32:04+00:00

Sorry for this curiosity that I have. sha1 use [a-f0-9] chars for its hashing

  • 0

Sorry for this curiosity that I have.

sha1 use [a-f0-9] chars for its hashing function. May I know why it doens’t use all the chars possible [a-z0-9] by using all chars availabe it could grealty increase the number of possibile different hash, thus lowering the probabilty of possibile collision.

If you don’t think this is a real question, just leave a comment I will instantly delete this question.

===

As stated in the answer, sha1 does NOT uses only 16 chars. The correct fact is: sha1 is 160 bits of binary data (cit.). I have added this to prevent confusion.

  • 1 1 Answer
  • 3 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-23T00:32:05+00:00Added an answer on May 23, 2026 at 12:32 am

    You’re confusing representation with content.

    sha1 is 160 bits of binary data. You can just as easily represent it with:

    hex: 0xf1d2d2f924e986ac86fdf7b36c94bcdf32beec15
    decimal: 1380568310619656533693587816107765069100751973397
    binary: 1111000111010010110100101111100100100100111010011000011010101100100001101111110111110111101100110110110010010100101111001101111100110010101111101110110000010101
    base 62: xufK3qj2bZgDrLA0XN0cLv1jZXc
    

    There’s nothing magical about hexidecimal. It’s just very common mechanism for showing content that breaks easily along 4-bit boundaries.

    The base 62 output is generated with this little bit of ruby:

    #!/usr/bin/ruby
    
    def chars_from_hex(s)
      c = s % 62
      s = s / 62
      if ( s > 0 )
        chars_from_hex(s)
      end
      if (c < 10)
          print c
      elsif (c < 36)
          print "abcdefghijklmnopqrstuvwxyz"[c-11].chr()
      elsif (c < 62)
          print "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[c-37].chr()
      else
          puts "error c", c
      end
    end
    
    chars_from_hex(0xf1d2d2f924e986ac86fdf7b36c94bcdf32beec15)
    

    It uses the standard idiom for converting from one base to another and treats 0-9 as 0-9, a-z as 10-35, A-Z as 36-61. It could be trivially extended to support more digits by including e.g. !@#$%^&*()-_=+\|[]{},.<>/?;:'"~` if one so desired. (Or any of the vast array of Unicode codepoints.)

    @yes123 asked about the ascii representation of the hash specifically, so here is the result of interpreting the 160-bit hash directly as ascii:

    ñÒÒù$é¬ý÷³l¼ß2¾ì
    

    It doesn’t look like much because:

    • ascii doesn’t have a good printable representation for byte values less than 32
    • ascii itself can’t represent byte values greater than 127, between 127 and 255 gets interpreted according to iso-8859-01 or other character encoding schemes

    This base conversion can be practically useful, too; the Base64 encoding method uses 64 (instead of my 62) characters to represent 6 bits at a time; it needs two more characters for ‘digits’ and a character for padding. UUEncoding chose a different set of ‘digits’. And a fellow stacker had a problem that was easily solved by changing the base of input numbers to output numbers.

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

Sidebar

Related Questions

Sorry this may be blatantly obvious but I have spent all morning trying to
Explanation I have a function that is passed the parameter options . This parameter
Sorry this is my first time to create/use a web service I have created
Sorry this is a basic question, but all my research just barely missed answering
Sorry this is probably super basic. But in all my javabean examples, I've not
Sorry this is probably a dumb question but I have been struggling with this
Sorry this might be a very stupid question. But I did have bug with
I am sorry this resembles to homework. But, I have just been unable to
I'm sorry this is probably a borderline poor question. Does anyone have experience using
Sorry this is probably a stupid question, as I couldn't find anything at all

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.