Giter Site home page Giter Site logo

Comments (5)

okocsis avatar okocsis commented on July 22, 2024

@caocongcong are we supposed to google translate your text?

from objective-c-rsa.

SnailLife avatar SnailLife commented on July 22, 2024

dispatch_queue_t queue = dispatch_queue_create("test", DISPATCH_QUEUE_CONCURRENT);
for (int i = 0; i< 100; i++) {
dispatch_async(queue, ^{
NSString *test = [[params md5String] uppercaseString];
NSString *test1 = [self p_publicKey];
NSString *test2 = [RSA encryptString:test publicKey:test1];
if (test2.length == 0) {
NSLog(@"出错啦");
NSLog(@"md5===%@", test);
NSLog(@"pubkey===%@", test1);
NSLog(@"encrypted===%@", test2);
} else {
NSLog(@"任务ccc===%@", test2);
}
});
}

会有出现test2为空的情况

我也遇到了 请问你解决了吗

from objective-c-rsa.

Tylor12 avatar Tylor12 commented on July 22, 2024

我也遇见了,请问怎么解决.

from objective-c-rsa.

ideawu avatar ideawu commented on July 22, 2024

RSA 在这个地方使用了公共的资源: https://github.com/ideawu/Objective-C-RSA/blob/master/RSA.m#L131 所以不是线程安全的. 目前的解决方案是在你的代码中避免多线程调用 encryptString().

from objective-c-rsa.

Tylor12 avatar Tylor12 commented on July 22, 2024

RSA 在这个地方使用了公共的资源: https://github.com/ideawu/Objective-C-RSA/blob/master/RSA.m#L131 所以不是线程安全的. 目前的解决方案是在你的代码中避免多线程调用 encryptString().

本来RSA加解密比较耗时的,不放在多线程中,感觉不太好.

from objective-c-rsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.