Created
March 4, 2020 11:58
-
-
Save jimmychu0807/b8a5e308255b4b92c779feabebf27a21 to your computer and use it in GitHub Desktop.
Markdium-用 Polkadot-JS API 輕鬆搭建 Substrate 前端
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 引入一些幫助函數 | |
import { stringToU8a, u8aToHex } from '@polkadot/util'; | |
// 創建信息 | |
const message = stringToU8a('a testing message'); | |
// 簽署信息 | |
const signature = alice.sign(message); | |
// 覈實信息 | |
const isValid = alice.verify(message, signature); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment