// 引用依赖
[dev-dependencies]
hex = "0.3.2"
// 打印bytes
let xx = format!("{}", hex::encode(&key[..]));
println!("x: {}",xx);
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 org.bitcoinj.core.Utils; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.GCMParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.security.SecureRandom; | |
import java.util.Base64; | |
/** |
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
""" | |
Class for performing Elliptic-curve Diffie-Hellman (ECDH) operations. | |
""" | |
from ecdsa.util import number_to_string | |
from ecdsa.ellipticcurve import INFINITY | |
from ecdsa import SigningKey, VerifyingKey | |
__all__ = [ | |
"ECDH", |
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 java.nio.ByteBuffer; | |
/** | |
* @Author:yong.huang | |
* @Date:2020-08-08 17:49 | |
*/ | |
public class Sha256 { | |
private static int[] H0 = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; |
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 java.math.BigInteger; | |
import java.util.Arrays; | |
/** | |
* @Author:yong.huang | |
* @Date:2020-08-09 15:48 | |
*/ | |
public class Base58 { | |
private static final char[] ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray(); |
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 com.google.zxing.BarcodeFormat; | |
import com.google.zxing.EncodeHintType; | |
import com.google.zxing.MultiFormatWriter; | |
import com.google.zxing.WriterException; | |
import com.google.zxing.common.BitMatrix; | |
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; | |
import java.util.Hashtable; |