I am using GNAT.SHA1 to create a SHA1 hash of a string in Ada. My code base is small, so I'd like to avoid importing any libraries to the project that aren't provided by my compiler, hence I'm using GNAT.SHA1. As far as I'm aware, the only "public" methods for retrieving the hash is in String form via the Digest function. I would like to instead get the 160-bit block that is the H member of the Context type. Unfortunately, the Context record is private. Is there any way I can get at it? Or is their an alternative method provided by GNAT or the Ada standard library?
Getting the SHA1 block from GNAT.SHA1
504 views Asked by Anthony At
1
There are 1 answers
Related Questions in SHA1
- Create HMAC SHA-1 in JS with byte array
- Restore sha-1 certificate fingerprint on OpenSSL without setting security level to zero
- Hash values do not match
- SHA1 implementation differs from builtin SHA1
- Rewriting Python SHA1 Digest code to Bash
- Why Truecaller SDK gives me an error: 40304, Invalid fingerprint in my flutter app?
- Twitter oauth_signature process
- Need SHA-1 certificate fingerprint to use Google Maps in Flutter, Get Error Unsupported class file major version 65
- Unable to find signingReport for SHA-1 fingerprint key in Gradle Bar : Android Studio Hedgehog
- How to check code integrity with SHA1 fingerprint?
- How to calculate SHA-1 fingerprint of an X.509 certificate in Flutter?
- Reference Error - SHA-1 for node_modules\@react-native\metro-config\node_modules\@react-native\js-polyfills\console.js is not computed
- The term '-alias' is not recognized , while generating SHA1 key for firebase
- Generate Openssl signature
- One or more of your Android apps have a SHA-1 fingerprint and package name combination that's in use
Related Questions in ADA
- How to properly handle byte buffers from C to Ada?
- ADA problem with value by reference or post conditions
- Order of evaluation in assignment statements
- Why Ada attribute 'value in this snippet doesn't raise Data_Error but Constraint_Error instead?
- How to write Recursive GCD program in Ada?
- Ada Calendar Arithmetic Difference 0 day between March 27 and March 28 2011
- Access constant as subtype of general access type
- How to conveniently parse a very specific chunk of a plaintext file in Ada?
- STORAGE_ERROR on assignment to array element
- Howto Re-Index an String in Ada?
- How to add < and > check in case ... when?
- How can I have more information in a Predicate_Failure?
- Tasking support in CortexM4-based board
- Receiving a `r' Fatal Error when trying to build basic Ada code
- MSYS2 - mingw64 Installing a package
Related Questions in GNAT
- Unbounded string `ENCODING_ERROR : bad input at Item`
- Linking erros xerces-c on GNAT
- Ada scale exceeds maximum value of 18
- Unexpected Ada Type Compatibility
- Installing Gnatstudio on RPI 4 v7
- Unable to link C source code with Ada static library (Error: libnewapi.a(unit1.o):unit1.adb:undefined reference to `__gnat_rcheck_CE_Overflow_Check')
- Could not find gnatmake binary after MacOS installation
- Possible memory leak using GNAT Regpat? What am I doing wrong?
- Bug in GNAT Get(FRom => SomeString, Item => SomeInteger, Last => Last)?
- Errors trying to run gnattest
- Create a record with a private part
- Is there a way to disable arithmetic operators on a specific type in Ada?
- Error setting the video mode when trying to run the compiled Game_Support example; GNAT Studio;
- How do I get useful data from a UDP socket using GNAT.Sockets in Ada?
- How would I define the __builtin_blendvps256 GCC intrinsic in Ada using GNAT?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I don't know of any direct way to get the 160-bit block, but of course you can compute it from the hexadecimal string.
Here's an example I just threw together. (Granted, extracting 32-bit integers by adding
"16#"and"#"to the hex substring may not be the most elegant solution.The output is: