Là một công cụ bảo mật, pubkey/eth-crypto đã đạt 924 sao trên GitHub, ngôn ngữ JavaScript. Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Encrypts the message with the publicKey so that only the corresponding privateKey can decrypt it. Returns (async) the encrypted data as object with hex-strings.
Signs a raw transaction with the privateKey. Returns a Promise that resolves a serialized tx-string which can be submitted to the node.
const identity = EthCrypto.createIdentity();
const rawTx = {
from: identity.address,
to: '0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0',
value: new BN('1000000000000000000'),
gasPrice: 5000000000,
nonce: 0,
gasLimit: 21000
};
const signedTx = await EthCrypto.signTransaction(
rawTx,
identity.privateKey
);
console.log(signedTx);
// > '071d3a2040a2d2cb...'
// you can now send the tx to the node
const receipt = await web3.eth.sendSignedTransaction(signedTx);
txDataByCompiled()
Creates the data-string which must be submitted with an transaction to create a contract-instance.
const SolidityCli = require('solidity-cli');
// create compiled solidity-code
const compiled = await SolidityCli.compileCode(
'contract ExampleContract {...'
)[':ExampleContract'];
const createCode = EthCrypto.txDataByCompiled(
compiled.interface, // abi
compiled.bytecode, // bytecode
[identity.address] // constructor-arguments
);
// now you can submit this to the blockchain
const serializedTx = await EthCrypto.signTransaction(
{
from: identity.address,
nonce: 0,
gasLimit: 5000000,
gasPrice: 5000000000,
data: createCode
},
identity.privateKey
);
const receipt = await web3.eth.sendSignedTransaction(serializedTx);
calculateContractAddress()
Calculates the address for the contract from the senders address and the nonce, without deploying it to the blockchain.
// pre-calculate address
const calculatedAddress = EthCrypto.calculateContractAddress(
account.address, // address of the sender
3 // nonce with which the contract will be deployed
);
const rawTx = {
from: account.address,
gasPrice: parseInt(gasPrice),
nonce: 3,
data: compiled.code
};
const receipt = await state.web3.eth.sendTransaction(rawTx);
console.log(receipt.contractAddress === calculatedAddress);
// > true
hex compress/decompress
"Compress" or "decompress" a hex-string to make it smaller. You can either compress to utf16 which reduces the size to about 1/4, or to base64 which reduces the size to about 4/5. This is not a real compression, it just make your string smaller when you have to store it in utf-16 anyways.
pubkey/eth-crypto thuộc nhóm Security trên TopGit, cùng 20 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về pubkey/eth-crypto ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/pubkey/eth-crypto là nguồn chính thức.
pubkey/eth-crypto có phải mã nguồn mở không?
Có — pubkey/eth-crypto phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/pubkey/eth-crypto.
pubkey/eth-crypto là gì?
pubkey/eth-crypto (pubkey/eth-crypto) là dự án JavaScript trên GitHub. Theo mô tả gốc: Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
pubkey/eth-crypto so với các dự án Security khác thế nào?
pubkey/eth-crypto được TopGit xếp vào nhóm Security, với 924 sao GitHub và viết bằng JavaScript. Xem trang chủ đề Security trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Vì sao pubkey/eth-crypto được xếp vào nhóm Security?
TopGit xếp pubkey/eth-crypto vào nhóm Security dựa trên GitHub topics và mô tả của repo (gắn thẻ: "blockchain", "cipher", "dapp"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về eth-crypto?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về eth-crypto.