Skip to content

Commit

Permalink
fix: Hex key import to support 0x prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
micwallace committed Aug 7, 2023
1 parent 3b4a773 commit e40f0c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/javascript/crypto/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/main/javascript/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tokenscript/attestation",
"version": "0.6.0-rc.2",
"version": "0.6.0-rc.3",
"description": "A library for integrating cryptographic attestations into applications",
"type": "commonjs",
"main": "dist/index.js",
Expand Down
3 changes: 3 additions & 0 deletions src/main/javascript/crypto/src/libs/KeyPair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export class KeyPair {

// hex string 129-130 symbols with leading 04 (it means uncompressed)
static fromPublicHex(publicHex: string){

publicHex = publicHex.replace("0x", "");

if (publicHex.toLowerCase().match(/^[a-f0-9]+$/i) === null) {
throw new Error('Wrong Hex string input');
}
Expand Down

0 comments on commit e40f0c7

Please sign in to comment.