-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/react-native-quick-crypto/nitrogen/generated/shared/c++/HybridHashSpec.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/// | ||
/// HybridHashSpec.cpp | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
#include "HybridHashSpec.hpp" | ||
|
||
namespace margelo::nitro::crypto { | ||
|
||
void HybridHashSpec::loadHybridMethods() { | ||
// load base methods/properties | ||
HybridObject::loadHybridMethods(); | ||
// load custom methods/properties | ||
registerHybrids(this, [](Prototype& prototype) { | ||
prototype.registerHybridMethod("copy", &HybridHashSpec::copy); | ||
}); | ||
} | ||
|
||
} // namespace margelo::nitro::crypto |
63 changes: 63 additions & 0 deletions
63
packages/react-native-quick-crypto/nitrogen/generated/shared/c++/HybridHashSpec.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/// | ||
/// HybridHashSpec.hpp | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
#pragma once | ||
|
||
#if __has_include(<NitroModules/HybridObject.hpp>) | ||
#include <NitroModules/HybridObject.hpp> | ||
#else | ||
#error NitroModules cannot be found! Are you sure you installed NitroModules properly? | ||
#endif | ||
|
||
// Forward declaration of `ArrayBuffer` to properly resolve imports. | ||
namespace NitroModules { class ArrayBuffer; } | ||
|
||
#include <NitroModules/ArrayBuffer.hpp> | ||
|
||
namespace margelo::nitro::crypto { | ||
|
||
using namespace margelo::nitro; | ||
|
||
/** | ||
* An abstract base class for `Hash` | ||
* Inherit this class to create instances of `HybridHashSpec` in C++. | ||
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. | ||
* @example | ||
* ```cpp | ||
* class HybridHash: public HybridHashSpec { | ||
* public: | ||
* HybridHash(...): HybridObject(TAG) { ... } | ||
* // ... | ||
* }; | ||
* ``` | ||
*/ | ||
class HybridHashSpec: public virtual HybridObject { | ||
public: | ||
// Constructor | ||
explicit HybridHashSpec(): HybridObject(TAG) { } | ||
|
||
// Destructor | ||
virtual ~HybridHashSpec() { } | ||
|
||
public: | ||
// Properties | ||
|
||
|
||
public: | ||
// Methods | ||
virtual std::shared_ptr<ArrayBuffer> copy() = 0; | ||
|
||
protected: | ||
// Hybrid Setup | ||
void loadHybridMethods() override; | ||
|
||
protected: | ||
// Tag for logging | ||
static constexpr auto TAG = "Hash"; | ||
}; | ||
|
||
} // namespace margelo::nitro::crypto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import type { HybridObject } from 'react-native-nitro-modules'; | ||
import type { TransformOptions } from 'readable-stream'; | ||
|
||
export interface Hash extends HybridObject<{ ios: 'c++'; android: 'c++' }> { | ||
copy(options: TransformOptions[]): ArrayBuffer; | ||
copy(): ArrayBuffer; | ||
} |