mirror of
https://github.com/status-im/dappconnect-chat-sdk.git
synced 2025-01-26 06:09:15 +00:00
parent
72d1e679fc
commit
cac8fe58be
@ -1,11 +1,11 @@
|
||||
import { keccak256 } from 'ethereum-cryptography/keccak'
|
||||
import { bytesToHex } from 'ethereum-cryptography/utils'
|
||||
import { bytesToHex, concatBytes } from 'ethereum-cryptography/utils'
|
||||
|
||||
export function payloadToId(
|
||||
payload: Uint8Array,
|
||||
publicKey: Uint8Array
|
||||
): string {
|
||||
const hash = keccak256(new Uint8Array([...publicKey, ...payload]))
|
||||
const hash = keccak256(concatBytes(payload, publicKey))
|
||||
const hex = bytesToHex(hash)
|
||||
|
||||
return `0x${hex}`
|
||||
|
Loading…
x
Reference in New Issue
Block a user