Skip to content

Instantly share code, notes, and snippets.

View debuggor's full-sized avatar
🥇
Focusing

debuggor debuggor

🥇
Focusing
View GitHub Profile
@debuggor
debuggor / QRterminal.java
Created April 21, 2021 06:07 — forked from hellokaton/QRterminal.java
Java二维码输出到控制台,需引入 zing 库,颜色代码见 https://gist.github.com/zfkun/9755885
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;
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();
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};
@debuggor
debuggor / notebook-rust.md
Created August 4, 2020 02:12
rust notebook

// 引用依赖
[dev-dependencies]  
hex = "0.3.2"

// 打印bytes
let xx = format!("{}", hex::encode(&key[..]));
println!("x: {}",xx);
"""
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",
@debuggor
debuggor / Aes256Gcm.java
Last active September 15, 2020 07:27
ecdh key exchange ; aes-256-gcm
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;
/**