sha1

Trying to Write NSString sha1 function, but it's returning null

一个人想着一个人 提交于 2019-11-29 04:52:14
I have the following Objective-C function: +(NSString *)stringToSha1:(NSString *)str{ NSMutableData *dataToHash = [[NSMutableData alloc] init]; [dataToHash appendData:[str dataUsingEncoding:NSUTF8StringEncoding]]; unsigned char hashBytes[CC_SHA1_DIGEST_LENGTH]; CC_SHA1([dataToHash bytes], [dataToHash length], hashBytes); NSData *encodedData = [NSData dataWithBytes:hashBytes length:CC_SHA1_DIGEST_LENGTH]; [dataToHash release]; NSString *encodedStr = [NSString stringWithUTF8String:[encodedData bytes]]; //NSString *encodedStr = [[NSString alloc] initWithBytes:[encodedData bytes] // length:

In my repo, how long must the longest hash prefix be to prevent any overlap?

徘徊边缘 提交于 2019-11-29 04:03:33
The --abbrev-commit flag can be used in conjunction with git log and git rev-list in order to show partial prefixes instead of the full 40-character SHA-1 hashes of commit objects. According to the Pro Git book , it defaults to using seven characters but makes them longer if necessary to keep the SHA-1 unambiguous [...] Additionally, short SHAs are at least 4-character long. Still according to the Pro Git book, Generally, eight to ten characters are more than enough to be unique within a project. As an example, the Linux kernel, which is a pretty large project with over 450k commits and 3.6

apparently same commits give different sha1, why?

▼魔方 西西 提交于 2019-11-29 03:43:22
After re-write of a subtree history from a repository with a script of mine, I compared it with what would do a git filter-branch ... on that same subtree. I see that initial commits have different sha1 although I expected them to be identical (consequence of this is that all commits from both histories have different sha1). Doing a git show --format=raw <commit-sha1> on both commits gives exactly the same output (except for first line, which is commit <commit-sha1> , introducing the result). Object files are completely different, but as they are binaries, I can't figure out the root cause.

How do I generate my MD5 and SHA1 thumbprints using eclipse for debug keystore (Android)

久未见 提交于 2019-11-29 02:44:34
Can I generate my MD5 and SHA1 thumbprints using eclipse for my debug keystore? also is there a code for to generate my hash key for facebook as well? get your sha1 and md5 thumbprint for debug keystore (also works for your other keystores). Go to you package exporler in eclipse (defaults to the left side) right click it>android tools>export signed application package Then navigate to your debug keystore normally in your .android folder and select it Then enter the password which is "android" with no quotes Next it will ask for an alias click the drop down list and select androiddebugkey and

one way SHA1 hash javascript implementation?

北城余情 提交于 2019-11-29 02:31:06
I have a server that is not using SSL, so I'm trying to find a way to secure the data being passed to the server. My first thought was jCryption , but it is not exactly what I need. So what I decided is that I could just pre-hash the password and send it to the server for comparison. So my question is, is there a sha1 utility that can be used for password verification purposes with PHP? leebriggs Try the Stanford Crypto library. It's pretty comprehensive but if you just need a single hashing function you can extract it from the core (it has sha1 and 256). Refer This You shouldn't be using SHA1

SignTool Not Signing ClickOnce App Using SHA256, Only Uses SHA1

百般思念 提交于 2019-11-28 23:40:54
I'm trying to sign my clickonce app. I have an EV code signing certificate that is using SHA256. The problem is that when I sign my app using the post build commands, it seems to be using SHA1 instead of SHA256. Here is a clip of the output window: Running Code Analysis... 1> Code Analysis Complete -- 0 error(s), 0 warning(s) 1> The following certificate was selected: 1> Issued to: Certificate Subject Name Here 1> 1> Issued by: DigiCert EV Code Signing CA (SHA2) 1> 1> Expires: Thu Apr 14 06:00:00 2016 1> 1> SHA1 hash: HASH-HERE 1> 1> 1> Done Adding Additional Store 1> Successfully signed and

How much can you truncate a SHA1 hash and be reasonably sure of having an unique ID?

ε祈祈猫儿з 提交于 2019-11-28 23:29:55
问题 I am making an application that stores documents and gives each one a UID based on a SHA1 digest of a few things including the timestamp. The digest has a lot of characters, and I want to allow users to identify the documents by using the first x characters of the full digest. What's a good value for x if the number of documents is maybe around 10K - 100K? 回答1: Adapting the formulas on on wikipedia for the Birthday problem, you can approximate the probability of collision as e^(-n^2/(2^(b+1))

Is any 64-bit portion of a 128-bit hash as collision-proof as a 64-bit hash?

南楼画角 提交于 2019-11-28 23:17:42
We're trying to settle an internal debate on our dev team: We're looking for a 64-bit PHP hash function. We found a PHP implementation of MurmurHash3 , but MurmurHash3 is either 32-bit or 128-bit, not 64-bit. Co-worker #1 believes that to produce a 64-bit hash from MurmurHash3, we can simply slice the first (or last, or any) 64 bits of the 128-bit hash and that it will be as collision-proof as a native 64-bit hash function. Co-worker #2 believes that we must find a native 64-bit hash function to reduce collisions and that 64-bit slices of a 128-bit hash will not be as collision proof as a

valgrind: failed to start tool 'memcheck' for platform 'x86-linux'

∥☆過路亽.° 提交于 2019-11-28 21:35:09
There comes a time in life of a developer when one gets this error valgrind: failed to start tool 'memcheck' for platform 'x86-linux' I do not see myself as an expert Valgrind user, but I understand output of Valgrind enough to catch memory leaks in my C programs. The other day I launched a personal project in assembly language and used standard C memory routines (calloc, realloc, free) for its memory requirements. The program grew complex and I wanted to be sure I am not leaking any memory (and also to be sure I am leaking memory where I know I am leaking at that stage - amid development),

微信JSSDK开发

狂风中的少年 提交于 2019-11-28 20:56:00
在微信中要进行页面自定义标题和内容分享,在2015之前都可以直接使用微信API---WeixinJSBridge,但是2015年1月被废除了。然后有了JSSDK,如果要进行自定义分享,只能先搞懂这个家伙了。 重点还是关注一下官方文档: http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html 讲的比较权威,比较全。 JSSDK 重点也是难点就是config的配置(难指的不是配置这个操作,而是获取配置内容),也就是自己项目和微信关系打通,之后的代码实现都很简单。 1、JSSDK官方说明文档: http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html 2、官方demo:(重点关注的是config的变化) http://203.195.235.76/jssdk/ 3、获得Access Token: https://mp.weixin.qq.com/debug/cgi-bin/apiinfo?t=index&type=基础支持&form=获取access_token接口/token 4、获取jsapi_ticket: https://api.weixin.qq.com/cgi-bin/ticket/getticket