File tree Expand file tree Collapse file tree 6 files changed +68
-7
lines changed
packages/react-native-quick-crypto
nitrogen/generated/shared/c++ Expand file tree Collapse file tree 6 files changed +68
-7
lines changed Original file line number Diff line number Diff line change @@ -1940,7 +1940,7 @@ SPEC CHECKSUMS:
19401940 fmt: 10c6e61f4be25dc963c36bd73fc7b1705fe975be
19411941 glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
19421942 hermes-engine: 46f1ffbf0297f4298862068dd4c274d4ac17a1fd
1943- NitroModules: 3a58d9bc70815a0d5de4476ed6a36eff05a6a0ae
1943+ NitroModules: c36d6f656038a56beb1b1bcab2d0252d71744013
19441944 OpenSSL-Universal: b60a3702c9fea8b3145549d421fdb018e53ab7b4
19451945 QuickCrypto: 11878b44cfc77fad2ea8f387a16e315841651305
19461946 RCT-Folly: 84578c8756030547307e4572ab1947de1685c599
Original file line number Diff line number Diff line change 1+ #include < memory>
2+ #include < NitroModules/ArrayBuffer.hpp>
3+ #include < OpenSSL/evp.h>
4+ #include < optional>
5+ #include < string>
6+ #include < vector>
7+
8+ #include " HybridHash.hpp"
9+
10+ namespace margelo ::nitro::crypto {
11+
12+ HybridHash::~HybridHash () {
13+ if (ctx) {
14+ EVP_MD_CTX_free (ctx);
15+ }
16+ }
17+
18+ void
19+ HybridHash::update () {
20+ // TODO
21+ }
22+
23+ void
24+ HybridHash::digest () {
25+ // TODO
26+ }
27+
28+ } // namespace margelo::nitro::crypto
Original file line number Diff line number Diff line change 1+ #include < memory>
2+ #include < NitroModules/ArrayBuffer.hpp>
3+ #include < OpenSSL/evp.h>
4+ #include < optional>
5+ #include < string>
6+ #include < vector>
7+
8+ #include " HybridHashSpec.hpp"
9+
10+ namespace margelo ::nitro::crypto {
11+
12+ using namespace facebook ;
13+
14+ class HybridHash : public HybridHashSpec {
15+ public:
16+ HybridHash () : HybridObject(TAG) {}
17+ ~HybridHash ();
18+
19+ public:
20+ // Methods
21+ void
22+ update () override ;
23+ void
24+ digest () override ;
25+
26+ private:
27+ // Properties
28+ EVP_MD_CTX *ctx = nullptr ;
29+ };
30+
31+ } // margelo::nitro::crypto
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ namespace margelo::nitro::crypto {
1414 HybridObject::loadHybridMethods ();
1515 // load custom methods/properties
1616 registerHybrids (this , [](Prototype& prototype) {
17- prototype.registerHybridMethod (" copy" , &HybridHashSpec::copy);
17+ prototype.registerHybridMethod (" update" , &HybridHashSpec::update);
18+ prototype.registerHybridMethod (" digest" , &HybridHashSpec::digest);
1819 });
1920 }
2021
Original file line number Diff line number Diff line change 1313#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
1414#endif
1515
16- // Forward declaration of `ArrayBuffer` to properly resolve imports.
17- namespace NitroModules { class ArrayBuffer ; }
1816
19- #include < NitroModules/ArrayBuffer.hpp>
17+
18+
2019
2120namespace margelo ::nitro::crypto {
2221
@@ -49,7 +48,8 @@ namespace margelo::nitro::crypto {
4948
5049 public:
5150 // Methods
52- virtual std::shared_ptr<ArrayBuffer> copy () = 0;
51+ virtual void update () = 0;
52+ virtual void digest () = 0;
5353
5454 protected:
5555 // Hybrid Setup
Original file line number Diff line number Diff line change 11import type { HybridObject } from 'react-native-nitro-modules' ;
22
33export interface Hash extends HybridObject < { ios : 'c++' ; android : 'c++' } > {
4- copy ( ) : ArrayBuffer ;
4+ update ( ) : void ;
5+ digest ( ) : void ;
56}
You can’t perform that action at this time.
0 commit comments