文件的project.pbxproj散列-使用什么散列以及如何使用? [英] project.pbxproj hashing for files - what hash is used and how?

查看:117
本文介绍了文件的project.pbxproj散列-使用什么散列以及如何使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您查看 project.pbxproj ,您将看到项目中的每个文件都有一个哈希值

If you look into project.pbxproj, you shall see that every file in the project has a hash

例如

1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };

1D60589F0D05DD5A006BFB54是链接的基础框架的哈希.

1D60589F0D05DD5A006BFB54 is the hash for the linked foundation framework.

我想知道这些是如何计算的,即使用什么函数以及除文件名之外的哪些元信息都输入到哈希的输入中.

I wonder how these are calculated i.e. what function is used and what meta information besides the file name goes into the input for the hash.

推荐答案

Objective-C:

Objective-C:

uuid_t uuid;
uuid_generate(uuid);
NSString *UUID = @"";
    for (int i = 0; i < 12; i++) UUID = [UUID stringByAppendingFormat:@"%02X", uuid[i]];

Python:

def GenerateId(cls):
        return ''.join(str(uuid.uuid4()).upper().split('-')[1:])

这篇关于文件的project.pbxproj散列-使用什么散列以及如何使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆