Skip to content

Instantly share code, notes, and snippets.

View hurui200320's full-sized avatar
🏝️
天匠染青红,花腰呈嬝娜。

天空Blond hurui200320

🏝️
天匠染青红,花腰呈嬝娜。
View GitHub Profile
@hurui200320
hurui200320 / FFT.kt
Created June 15, 2023 10:03
FFT for any input size in Kotlin JVM with Apache Commons Math3
package info.skyblond.steganography.fourier
import info.skyblond.steganography.add
import info.skyblond.steganography.div
import info.skyblond.steganography.plus
import info.skyblond.steganography.times
import org.apache.commons.math3.complex.Complex
import org.apache.commons.math3.primes.Primes
import org.apache.commons.math3.transform.DftNormalization
import org.apache.commons.math3.transform.FastFourierTransformer
@hurui200320
hurui200320 / GPS.kt
Last active April 28, 2023 06:05
Chinese GPS coordinate calculate
import java.math.BigDecimal
import kotlin.math.*
/**
* No need to apply transformations on non-Chinese coordinates.
*
* This is not follow the geo definition line. It just thinks a square.
* */
fun isOutOfChina(lat: Double, lng: Double): Boolean {
if (lng < 72.004 || lng > 137.8347) {
@hurui200320
hurui200320 / ECDH.kt
Last active May 6, 2022 11:57
Kotlin ECDH with BouncyCastle
package info.skyblond.crypto
import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey
import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey
import org.bouncycastle.jce.ECNamedCurveTable
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.bouncycastle.jce.spec.ECPrivateKeySpec
import org.bouncycastle.jce.spec.ECPublicKeySpec
import java.math.BigInteger
import java.security.*
@hurui200320
hurui200320 / miui-fastboot-howto.rst
Created October 12, 2021 14:11 — forked from j-jith/miui-fastboot-howto.rst
How to flash MIUI Fastboot ROM from Linux

How to flash MIUI Fastboot ROM from Linux

{"sig":"a5546c17eb1826c90b49ca13d5d73a5ec5bd85ce788f8ee1d08d26e5b5a2c11e4da68577f74527b82fe7eced25180147331c52230de24427945fdd46ef2431f61","msghash":"b1506e74aef6ca9f56953e5d7dd652a749a5aab1af09cdc2db585b4b7adecf9e"}