草庐IT

sha1_context

全部标签

ios - CoreData 嵌套上下文 : what is the proper way to save context?

我正在使用嵌套上下文模式来支持CoreData的多线程工作。我有CoredDataManager单例类,上下文的初始化是:self.masterContext=[[NSManagedObjectContextalloc]initWithConcurrencyType:NSPrivateQueueConcurrencyType];self.masterContext.persistentStoreCoordinator=self.persistentStoreCoordinator;self.mainContext=[[NSManagedObjectContextalloc]initWi

Objective-C SHA2 哈希无法与非 ASCII 一起正常工作

我正在使用xcode,这是我的sha512方法:-(NSString*)sha512:(NSString*)input{constchar*cstr=[inputcStringUsingEncoding:NSUTF8StringEncoding];NSData*data=[NSDatadataWithBytes:cstrlength:input.length];uint8_tdigest[CC_SHA512_DIGEST_LENGTH];CC_SHA512(data.bytes,data.length,digest);NSMutableString*output=[NSMutableS

ios - .net 与 Objective c SHA-512 不匹配

我正在尝试从.net函数编写用于在目标中创建sha512字符串的函数,它是publicstaticstringGetSHA512(stringstrPlain){UnicodeEncodingUE=newUnicodeEncoding();byte[]HashValue=null;byte[]MessageBytes=UE.GetBytes(strPlain);System.Security.Cryptography.SHA512ManagedSHhash=newSystem.Security.Cryptography.SHA512Managed();stringstrHex=stri

android - java.lang.NoSuchMethodError : No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)

将我的AndroidStudio更新到3.0后,我收到NostaticmethodgetFont()错误。我正在从事的项目在github上,https://github.com/ik024/GithubBrowser//Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{jcenter()maven{url"https://oss.sonatype.org/content/repositories/snapshots"}}

android - java.lang.NoSuchMethodError : No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)

将我的AndroidStudio更新到3.0后,我收到NostaticmethodgetFont()错误。我正在从事的项目在github上,https://github.com/ik024/GithubBrowser//Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{jcenter()maven{url"https://oss.sonatype.org/content/repositories/snapshots"}}

iOS 11 [MediaRemote] [AVOutputContext] 警告 : AVF context unavailable for MRAVOutputContextCreateIndependentRoutingContext

我在iOS应用程序中使用视频播放器(框架MediaPlayer)。如果我将设备旋转为横向,视频不会旋转为横向。仅在iOS11上没有视频旋转。iOS9、10-旋转良好。在启动视频播放器之前和设备旋转时,XCode收到消息:[MediaRemote][AVOutputContext]WARNING:AVFcontextunavailableforMRAVOutputContextCreateIndependentRoutingContext旋转视频怎么办? 最佳答案 当我删除所有断点后,我的问题就解决了。也许您可以尝试一下,希望它也能为

android - 大数的 SHA256 哈希结果在 Android 和 iOS 上不同

我正在尝试对BigInteger/BigNum进行哈希处理,但在Android/iOS中得到了不同的结果。我需要获得相同的哈希结果,以便两个应用程序都按照SRP协议(protocol)工作。仔细检查它对正数工作正常但对负数不起作用(第一个半字节大于7)。不确定哪个是正确的,哪个是要调整以与另一个匹配。安卓:voidhashBigInteger(Strings){try{BigIntegera=newBigInteger(s,16);MessageDigestsha=MessageDigest.getInstance("SHA-256");byte[]b=a.toByteArray();

ios - 核心数据 : Parent context and change propagation

我的应用程序中有以下核心数据设置:PersistentStoreCoordinator^BackgroundMOC(NSPrivateQueueConcurrencyType)^MainQueueMOC(NSMainQueueConcurrencyType)初始化代码如下:_backgroundContext=[[NSManagedObjectContextalloc]initWithConcurrencyType:NSPrivateQueueConcurrencyType];[_backgroundContextsetPersistentStoreCoordinator:self.c

ios - 从 Core Data Managed Object Context 中删除插入但未保存的对象

有没有办法删除已插入上下文但尚未保存的单个托管对象?我想删除单个对象,而不是回滚整个上下文。我试过调用deleteObject:但它抛出异常,因为根据核心数据,该对象在MOC中尚不存在。通过查看核心数据的insertedobjects属性,我肯定知道它已被插入,通过查看deleted对象,我知道它已被标记为删除。本质上我想“取消插入”该对象。先保存再删除是NotAcceptable。谢谢。 最佳答案 事实证明,对尚未持久化的对象调用deleteObject:是完全合法的。根据Apple的文档:Ifobjecthasnotyetbee

iphone - CGContextFillRects : invalid context - Objective C

我有这段代码可以为我的图像提供我需要的颜色:-(UIImage*)convertToMask:(UIImage*)image{UIGraphicsBeginImageContextWithOptions(image.size,NO,image.scale);CGRectimageRect=CGRectMake(0.0f,0.0f,image.size.width,image.size.height);CGContextRefctx=UIGraphicsGetCurrentContext();//Drawawhitebackground(forwhitemask)CGContextSet