sha1

Calculating the info-hash of a torrent file

余生颓废 提交于 2019-11-27 09:33:55
I'm using C++ to parse the info hash of a torrent file, and I am having trouble getting a "correct" hash value in comparison to this site: http://i-tools.org/torrent I have constructed a very simple toy example just to make sure I have the basics right. I opened a .torrent file in sublime and stripped off everything except for the info dictionary, so I have a file that looks like this: d6:lengthi729067520e4:name31:ubuntu-12.04.1-desktop-i386.iso12:piece lengthi524288e6:pieces27820:¡´E¶ˆØËš3í ..............(more unreadable stuff.....).......... I read this file in and parse it with this code:

Android SHA1 release keystore not working with Google Maps

[亡魂溺海] 提交于 2019-11-27 07:26:09
I am using the Google Maps Android API and I'm running into some issues. I am signing my apk with android studio (created one at .android/keystore.jks). Also I'm selecting "release" as type in it. I have used the command keytool -list -v -keystore C:\Users\Toshiba\.android\keystore.jks to get the SHA1 fingerprint out of the keystore. The SHA1 is correct, but the Map is not shown on a signed APK. It is shown in a debug APK. Using keytool with the release keystore (keystore.jks) will get me this: SHA1: 33:46:07:82:5B:D4:45:D2:60:CE:5A:29:97:9F:6C:44:XX:XX:XX:XX The debug one works fine (I have

What is the format of a git tag object and how to calculate its SHA?

南笙酒味 提交于 2019-11-27 07:22:20
问题 I am familiar with how Git creates SHA1 hashes for files (blobs), but not how they are created for tag objects. I assume they are, if I create an annotated tag, but what is the recipe? And how might I replicate it outside of Git (e.g., in Perl or Python)? 回答1: The content of a tag object is as follows: object <commit-sha1> type commit tag <tag-name> tagger <author-with-timestamp> <tag-message> Based on that text the SHA1 value is calculated. how might I replicate it outside of Git (e.g., in

How can I pass git SHA1 to compiler as definition using cmake?

◇◆丶佛笑我妖孽 提交于 2019-11-27 06:11:26
In a Makefile this would be done with something like: g++ -DGIT_SHA1="`git log -1 | head -n 1`" ... This is very useful, because the binary knows exact commit SHA1 so it can dump it in case of segfault. How can I achieve the same with CMake? Ryan Pavlik I've made some CMake modules that peer into a git repo for versioning and similar purposes - they're all in my repository at https://github.com/rpavlik/cmake-modules The good thing about these functions is, they will force a re-configure (a rerun of cmake) before a build every time the HEAD commit changes. Unlike doing something just once with

How do I create a SHA1 hash in ruby?

纵然是瞬间 提交于 2019-11-27 06:09:06
SHA Hash functions require 'digest/sha1' Digest::SHA1.hexdigest 'foo' For a Base64 encoded hash, to validated an Oauth signature, I used require 'base64' require 'hmac-sha1' Base64.encode64((HMAC::SHA1.new('key') << 'base').digest).strip I created a helper gem which is a simple wrapper around some sha1 code require 'rickshaw' > Rickshaw::SHA1.hash('LICENSE.txt') => "4659d94e7082a65ca39e7b6725094f08a413250a" > "hello world".to_sha1 => "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed" r4ccoon Where 'serialize' is some user function defined elsewhere. def generateKey(data) return Digest::SHA1.hexdigest

MD5 and SHA1 C++ hashing library

ε祈祈猫儿з 提交于 2019-11-27 06:07:49
问题 I'm trying to find a good (and well documented) hashing library to use with my C++ program, I only need to generate two hashes from a string. I've tried with crypto++ and mhash and I didn't manage to make them work, also with http://www.zedwood.com/article/121/cpp-md5-function I would be glad if this library is cross-platform. 回答1: Try this open source library http://hashlib2plus.sourceforge.net/ 回答2: Search before ask, there is already question: What is the best encryption library in C/C++?

Android: Google Map v2 not showing map for release apk

假装没事ソ 提交于 2019-11-27 05:40:24
问题 My google map app works fine on device with debug google map API KEY but when I create signed apk for my app with release google map API KEY, it does not display map. To generate release mode google API KEY , i am using SHA1 fingerprint with my keystore. And i am also defining "signing and build types" in my project Settings as explained by developer.android.com(http://developer.android.com/tools/publishing/app-signing.html). Tried every possible solution(removing apk and than reinstalling it

How to hash a large object (dataset) in Python?

不羁岁月 提交于 2019-11-27 05:22:23
问题 I would like to calculate a hash of a Python class containing a dataset for Machine Learning. The hash is meant to be used for caching, so I was thinking of md5 or sha1 . The problem is that most of the data is stored in NumPy arrays; these do not provide a __hash__() member. Currently I do a pickle.dumps() for each member and calculate a hash based on these strings. However, I found the following links indicating that the same object could lead to different serialization strings: Hash of

Check if my SSL Certificate is SHA1 or SHA2

戏子无情 提交于 2019-11-27 05:16:28
问题 I have tried to find the answer to this but I couldn't find an answer... How do I check if my SSL Certificate is using SHA1 or SHA2? Reason I ask is because it might have to do with the certificate not loading on Mozilla Browers.... Any ideas? Can I check through cPanel? 回答1: You can check by visiting the site in your browser and viewing the certificate that the browser received. The details of how to do that can vary from browser to browser, but generally if you click or right-click on the

C# SHA-1 vs. PHP SHA-1…Different Results?

邮差的信 提交于 2019-11-27 03:56:23
I am trying to calculate a SHA-1 Hash from a string, but when I calculate the string using php's sha1 function I get something different than when I try it in C#. I need C# to calculate the same string as PHP (since the string from php is calculated by a 3rd party that I cannot modify). How can I get C# to generate the same hash as PHP? Thanks!!! String = s934kladfklada@a.com C# Code (Generates d32954053ee93985f5c3ca2583145668bb7ade86) string encode = secretkey + email; UnicodeEncoding UE = new UnicodeEncoding(); byte[] HashValue, MessageBytes = UE.GetBytes(encode); SHA1Managed SHhash = new