You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Is it possible to sign/verify buffer/uint8array?
Strings are arguably not best representation of data, and when getting big, taking quite a some time for this library (and overall, any cryptographic algorithm) to verify.
I used hash of data to convert it to smaller one, however I feel like stringifying hash in order for this library to process it is not optimal.
Is there any issues with signing/verifying raw data?
The text was updated successfully, but these errors were encountered:
Although it is not the intended usage, you can use a Buffer as a message. For example:
const{ Signer, Verifier }=require('bip322-js');constprivateKey='L3VFeEujGtevx9w18HD1fhRbCH67Az2dpCymeRE1SoPK6XQtaN2k';constaddress='bc1q9vza2e8x573nczrlzms0wvx3gsqjx7vavgkx0l';// P2WPKH addressconstmessage=Buffer.from('000102030405ff','hex');// Some random Bufferconstsignature=Signer.sign(privateKey,address,message);constvalidity=Verifier.verifySignature(address,message,signature);console.log(validity);// True
If you use TypeScript, you may need to typecast the message to any or skip type-checking for this to work. Technically speaking, the library already supports using a Buffer as a message.
Hello! Is it possible to sign/verify buffer/uint8array?
Strings are arguably not best representation of data, and when getting big, taking quite a some time for this library (and overall, any cryptographic algorithm) to verify.
I used hash of data to convert it to smaller one, however I feel like stringifying hash in order for this library to process it is not optimal.
Is there any issues with signing/verifying raw data?
The text was updated successfully, but these errors were encountered: