Perry natively implements password hashing, JWT tokens, and Ethereum cryptography.
{{#include ../../examples/stdlib/crypto/snippets.ts:bcrypt}}{{#include ../../examples/stdlib/crypto/snippets.ts:argon2}}{{#include ../../examples/stdlib/crypto/snippets.ts:jwt}}{{#include ../../examples/stdlib/crypto/snippets.ts:crypto-node}}The ethers runtime exposes utility functions (formatEther, formatUnits,
parseEther, parseUnits, getAddress) but the higher-level
Wallet.createRandom() constructor flow shown below is not yet wired into
the LLVM backend. Track the follow-up at issue #199.
import { ethers } from "ethers";
// Create a wallet
const wallet = ethers.Wallet.createRandom();
console.log(wallet.address);
// Sign a message
const signature = await wallet.signMessage("Hello, Ethereum!");