diff --git a/walletjs.html b/walletjs.html index bfec4a8..e0d556e 100644 --- a/walletjs.html +++ b/walletjs.html @@ -1601,6 +1601,25 @@ } return arr; } + + //生成二维码 + function generateQrcode(content, parentElement){ + var arr = mySplit(content, 400); + for(var i = 0; i < arr.length; i++){ + jQuery(function(){jQuery("#" + parentElement).qrcode(str2rstr_utf8(arr[i]));}); + document.getElementById(parentElement).appendChild(document.createElement("br")); + document.getElementById(parentElement).appendChild(document.createElement("br")); + } + } + + //清除二维码 + function deleteQrcode(parentElement){ + if(document.getElementById(parentElement).childNodes.length > 0){ + while(document.getElementById(parentElement).childNodes.length > 0){ + document.getElementById(parentElement).childNodes[0].remove(); + } + } + }
@@ -1619,10 +1638,10 @@The brain regulations must include hash values and require replacement or cropping modifications to the hash values. For example, it can be set as: BrainPassword1+X(SHA256(BrainPassword2))+Y(SHA256(SHA256(BrainPassword3))+… Among them, X() and Y() are modifications to the hash value.
脑规则中必须包括哈希值,且需要对哈希值进行替换或裁剪修改。例如可以设置成:脑口令1+X(SHA256(脑口令2))+Y(SHA256(SHA256(脑口令3)))+...,其中X()、Y()即对哈希值的修改。
几乎所有的64位16进制字符串都可以作为私钥。合法私钥的取值范围(0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)。
Compressed public key: Prefix (if y is even, prefix is 02; if y is odd, prefix is 03)+X coordinate (32 bytes); Uncompressed public key: Prefix (04)+X coordinate (32 bytes)+Y coordinate (32 bytes).
压缩公钥:前缀(如果y是偶数,前缀是02;如果y是奇数,前缀是03)+X坐标(32字节);未压缩公钥:前缀(04)+X坐标(32字节)+Y坐标(32字节)。
The final Bech32Check encoding address=Prefix+Separator+Data(Version+Bech32 Address)+Checksum. The encode function calculates and concatenates prefixe, separator, Bech32 addresses with version numbers, and checksums. The checksum is a six character code calculated using the prefix and the Bech32 address with a version number, concatenated directly to the end.
最终的Bech32Check编码地址=前缀+分隔符+数据(版本号+"裸"Bech32地址)+校验码。encode函数完成前缀、分隔符、带版本号"裸"Bech32地址和校验码计算及拼接。校验码是通过前缀和带版本号的"裸"Bech32地址计算出来的6个字符,直接拼接到最后。
1. Actually, it is to sign the double hash value SHA256 (hexTobytes (SHA256 (hexTobytes) to be signed). 2. For security reasons, random numbers are introduced during the signature process. When signing the same information, the signature value changes every time, but each signature value is valid.
1.实际上是对待签名的双哈希值SHA256(hexToBytes(SHA256(hexToBytes(待签名信息))))进行签名。2.为了安全,签名时引入了随机数,对同一信息进行签名时,每次签名值都发生变化,但每个签名值都是有效的。
Almost all 64 bit hex strings can be used as private keys. The range of values for legitimate private keys is (0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)
几乎所有的64位16进制字符串都可以作为私钥。合法私钥的取值范围(0,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)。
public key: X coordinate (32 bytes)+Y coordinate (32 bytes).
公钥:X坐标(32字节)+Y坐标(32字节)。
Ethereum implicitly adds checksums by introducing uppercase letters to prevent accidentally entering incorrect addresses. The rule is: (1) First, treat the address as a string (excluding the starting '0x'), and calculate the Keccak value; (2) If the value of the i-th bit of the Keccak value is ≥ 8, then the i-th bit of the address is changed to uppercase letters.
以太坊通过引入大写字母来隐含加入校验和,防止不小心输错地址。其规则是:(1)先将地址看成字符串(不包括开头的0x),并计算Keccak值;(2)如果Keccak值的第i位的值≥8,那么地址的第i位改成大写字母。
- + -