Method: Klay::Signature#prefix_message

Defined in:
lib/klay/signature.rb

#prefix_message(message) ⇒ String

Prefix message as per EIP-191 with 0x19 to ensure the data is not valid RLP and thus not mistaken for a transaction. EIP-191 Version byte: 0x45 (E) Ref: https://eips.ethereum.org/EIPS/eip-191

Parameters:

  • message (String)

    the message string to be prefixed.

Returns:

  • (String)

    an EIP-191 prefixed string.



40
41
42
# File 'lib/klay/signature.rb', line 40

def prefix_message(message)
  "\u0019Klaytn Signed Message:\n#{message.size}#{message}"
end