Skip to content

Instantly share code, notes, and snippets.

View olegcherr's full-sized avatar

Oleg Cherr olegcherr

View GitHub Profile
@olegcherr
olegcherr / Base62.kt
Created May 13, 2020 20:07
Base62 encoding/decoding
import java.math.BigInteger
/**
* Base62 encoder/decoder.
*/
object Base62 {
private val BASE = BigInteger.valueOf(62)
private val DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
/**
@olegcherr
olegcherr / XCheckPermission.java
Created May 12, 2017 12:01
Android: Checking MIUI permissions
/*
* Copyright (c) 2017.
* qsboy.com 版权所有
* https://github.com/JasonQS/Anti-recall/blob/ec45306/Java/XCheckPermission.java
*/
package com.qiansheng.messagecapture;
import android.app.AppOpsManager;
import android.content.Context;
@olegcherr
olegcherr / simpleMeasureTest.kt
Last active May 14, 2022 10:21
Simple Kotlin micro-benchmarking tool (Android supported)
package azagroup.test
import java.util.ArrayList
/**
* Iterates provided by [callback] code [ITERATIONS]x[TEST_COUNT] times.
* Performs warming by iterating [ITERATIONS]x[WARM_COUNT] times.
*/
fun simpleMeasureTest(