Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Commit 0308bbb

Browse files
committed
Update hashPersonalMessage
1 parent 5e9e391 commit 0308bbb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/signature.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ export const isValidSignature = function(
134134
* used to produce the signature.
135135
*/
136136
export const hashPersonalMessage = function(message: any): Buffer {
137-
const prefix = toBuffer(`\u0019Ethereum Signed Message:\n${message.length.toString()}`)
137+
const prefix = Buffer.from(
138+
`\u0019Ethereum Signed Message:\n${message.length.toString()}`,
139+
'utf-8',
140+
)
138141
return keccak(Buffer.concat([prefix, message]))
139142
}
140143

0 commit comments

Comments
 (0)