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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:40:22+00:00 2026-06-08T14:40:22+00:00

I know that is a duplicate question from here : Link I tried to

  • 0

I know that is a duplicate question from here : Link

I tried to do a little more research into if its possible or no at-all.
and I see that it is possible.

The only thing I want to get is what is the function that I need to use to convert a string to an integer in shell scripting. SHA1 is a 160bit long integer.

Motivation behind doing it on shell scripting : trying to learning it.

For example I get the sha1 of a file by storing it in a variable like this

store=`sha1 $blah | cut -d  ' ' -f 1`

it gives me the hash . But what if I want to convert it to integer.

  • 1 1 Answer
  • 0 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-06-08T14:40:23+00:00Added an answer on June 8, 2026 at 2:40 pm

    Impossible. For the shell, everything is a string. If you leave POSIX, and declare shell variables as having integer type, the width of the integer is usually that of the underlying C library, i.e. 32 or 64 bit. SHA1 hashes with 160bits don’t fit.
    However, there are the bc and dc utilities, which allow arbitrary precision arithmetic.
    If you just want to convert the hex string to a decimal number, use this:

    $ bc << EOF
    obase=10
    ibase=16
    DA19BAC0F234635B6DE9362369DA07A6A4162865
    1245133775210903227706347819370390008085985241189
    EOF
    

    Note that you MUST USE CAPITAL HEX DIGITS, because bc won’t recognize a-f.

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

Sidebar

Related Questions

Possible Duplicate: Hide facebook app from search Okay, I know that this question was
Possible Duplicate: String, StringBuffer, and StringBuilder We know that String are immutable where StringBuffer
I know that this sort of question has been asked here before, but still
I dont know if this is a duplicate but here's my question.. I was
I know that this might be a duplicate of this question but that was
I have a question here that looks a little like some of the ones
I have NSArray and I want to remove duplicates from it. I know that
I want to know is there any way that I can remove duplicates from
I know that Java have its own garbage collection, but sometimes I want to
I would like to apologize if the duplicate of this question exist. i tried

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.