@helium/crypto-react-native
Advanced tools
Comparing version
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import Address, { KeyTypes, NetTypes } from '@helium/address'; | ||
@@ -3,0 +4,0 @@ import Mnemonic from './Mnemonic'; |
@@ -67,3 +67,5 @@ "use strict"; | ||
async sign(message) { | ||
const messageBuffer = Buffer.from(message); | ||
const messageBuffer = typeof message === 'string' | ||
? Buffer.from(message) | ||
: Buffer.from(message.buffer); | ||
const signature = await react_native_sodium_1.default.crypto_sign_detached(messageBuffer.toString('base64'), this.privateKey.toString('base64')); | ||
@@ -70,0 +72,0 @@ return Uint8Array.from(Buffer.from(signature, 'base64')); |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
export type MnemonicLength = 12 | 24; | ||
@@ -3,0 +4,0 @@ export default class Mnemonic { |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
export declare const randomBytes: (n: number) => Promise<Buffer>; | ||
@@ -3,0 +4,0 @@ export declare const lpad: (str: string | any[], padString: string, length: number) => string | any[]; |
{ | ||
"name": "@helium/crypto-react-native", | ||
"version": "4.12.1-alpha.0", | ||
"version": "4.13.1", | ||
"description": "Cryptography utilities including mnemonics, keypairs and base58-check encoding for React Native", | ||
@@ -30,8 +30,11 @@ "keywords": [ | ||
"dependencies": { | ||
"@helium/address": "^4.12.1-alpha.0", | ||
"js-sha256": "^0.9.0", | ||
"@helium/address": "^4.13.1", | ||
"js-sha256": "^0.11.0", | ||
"react-native-sodium": "^0.4.0", | ||
"safe-buffer": "^5.2.1" | ||
}, | ||
"gitHead": "07cb9296684f4ce20031019db476d35ae82df271" | ||
"gitHead": "4a3dfa4f707ca13b87fd427c8b02e0c405ef6047", | ||
"devDependencies": { | ||
"@types/node": "^22.14.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
60685
0.52%2317
0.22%0
-100%1
Infinity%1
Infinity%- Removed
Updated
Updated