This file contains 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
private fun decreaseImage(context: Context?, uri: Uri) { | |
// println("$TAG , decreaseImage ...") | |
context?.let { | |
// println("$TAG , decreaseImage ${uri.path}") | |
val byteArray = | |
IOUtils.toByteArray(it.contentResolver.openInputStream(uri)) | |
// println("$TAG , decreaseImage ${byteArray.size}") | |
val filename = (uri.lastPathSegment ?: "file_${SystemClock.elapsedRealtime()}") | |
.replace(":", "_") |
This file contains 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
package chela.spring.core; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.util.Base64; | |
final public class ChCrypto { | |
final static Base64.Encoder encorder = Base64.getEncoder(); | |
final static Base64.Decoder decorder = Base64.getDecoder(); |