Skip to content

Commit

Permalink
feat: change lifehash to sparrow recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
debeldami committed Jan 2, 2025
1 parent a071018 commit 62d0313
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/app/components/secret-item/secret-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export class SecretItemComponent implements OnInit {

this.getWalletsFromSecret()

this.lifehashData = await this.lifehashService.generateLifehash(this.secret.fingerprint)
const bytes = new Uint8Array(this.secret.fingerprint.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)))

this.lifehashData = await this.lifehashService.generateLifehash(bytes)
}

public async getWalletsFromSecret() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/lifehash/lifehash.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { LifeHash, LifeHashVersion } from 'lifehash'
export class LifehashService {
constructor() {}

public async generateLifehash(str: string) {
public async generateLifehash(str: string | Uint8Array) {
const image = LifeHash.makeFrom(str, LifeHashVersion.version2, 1, true)
return image.toDataUrl()
}
Expand Down

0 comments on commit 62d0313

Please sign in to comment.