Skip to content

Commit

Permalink
fix: remove 0x in bzz address
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafe137 committed Sep 16, 2024
1 parent 1fcc085 commit 3bd5873
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/bzz-address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export class BzzAddress {
const parts = url.split('/')
this.hash = parts[0].toLowerCase()

if (this.hash.startsWith('0x')) {
this.hash = this.hash.slice(2)
}

if (!/[a-z0-9]{64,128}/.test(this.hash)) {
throw new CommandLineError('Invalid BZZ hash: expected 64 or 128 long hexadecimal hash')
}
Expand Down

0 comments on commit 3bd5873

Please sign in to comment.