File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/react-polkicon-source" ,
33 "description" : " A light-weight and customisable Polkadot Icon" ,
4- "version" : " 3.2.7 " ,
4+ "version" : " 3.2.11 " ,
55 "license" : " GPL-3.0-only" ,
66 "type" : " module" ,
77 "keywords" : [
Original file line number Diff line number Diff line change 22SPDX-License-Identifier: GPL-3.0-only */
33
44import { blake2AsU8a } from '@w3ux/crypto'
5- import { encodeAddress } from 'dedot/utils'
5+ import { decodeAddress } from 'dedot/utils'
66import { PolkiconCenter , SCHEMA } from './consts'
77import type { Coordinate , Scheme } from './types'
88
@@ -146,11 +146,11 @@ const findScheme = (d: number): Scheme => {
146146 * consistent `Uint8Array` ID derived from the address.
147147 */
148148const addressToId = ( address : string ) : Uint8Array => {
149- // Generate a zero hash from a 32-byte zeroed array.
150- const zeroHash = blake2AsU8a ( new Uint8Array ( 32 ) )
149+ // Generate a zero hash from a 32-byte zeroed array using 512-bit blake2 hash .
150+ const zeroHash = blake2AsU8a ( new Uint8Array ( 32 ) , 512 )
151151
152- // Get the encoded and decoded representation of the address, then hash it.
153- const pubKeyHash = blake2AsU8a ( encodeAddress ( address ) )
152+ // Get the decoded representation of the address, then hash it with 512-bit blake2 .
153+ const pubKeyHash = blake2AsU8a ( decodeAddress ( address ) , 512 )
154154
155155 // Adjust each byte in the hash relative to zeroHash and return as a Uint8Array.
156156 return pubKeyHash . map ( ( x , i ) => ( x + 256 - zeroHash [ i ] ) % 256 )
You can’t perform that action at this time.
0 commit comments