mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
add tools for passport files hashes calculation
This commit is contained in:
parent
1d99e632a4
commit
2f52ad45a4
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
* `Version`:
|
* `Version`:
|
||||||
* `MicroUtils`: `0.4.16` -> `0.4.19`
|
* `MicroUtils`: `0.4.16` -> `0.4.21`
|
||||||
* `Core`:
|
* `Core`:
|
||||||
* **BREAKING CHANGE** Now `MediaGroupMessage` have a generic type related to `MediaGroupContent`
|
* **BREAKING CHANGE** Now `MediaGroupMessage` have a generic type related to `MediaGroupContent`
|
||||||
* Methods and types related to `MediaGroupMessage` have been modified according to their meanings
|
* Methods and types related to `MediaGroupMessage` have been modified according to their meanings
|
||||||
|
@ -12,7 +12,7 @@ klock_version=2.0.3
|
|||||||
uuid_version=0.2.3
|
uuid_version=0.2.3
|
||||||
ktor_version=1.5.0
|
ktor_version=1.5.0
|
||||||
|
|
||||||
micro_utils_version=0.4.20
|
micro_utils_version=0.4.21
|
||||||
|
|
||||||
javax_activation_version=1.1.1
|
javax_activation_version=1.1.1
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ kotlin {
|
|||||||
api "com.soywiz.korlibs.klock:klock:$klock_version"
|
api "com.soywiz.korlibs.klock:klock:$klock_version"
|
||||||
api "com.benasher44:uuid:$uuid_version"
|
api "com.benasher44:uuid:$uuid_version"
|
||||||
|
|
||||||
|
api "dev.inmo:micro_utils.crypto:$micro_utils_version"
|
||||||
api "dev.inmo:micro_utils.coroutines:$micro_utils_version"
|
api "dev.inmo:micro_utils.coroutines:$micro_utils_version"
|
||||||
api "dev.inmo:micro_utils.serialization.base64:$micro_utils_version"
|
api "dev.inmo:micro_utils.serialization.base64:$micro_utils_version"
|
||||||
api "dev.inmo:micro_utils.serialization.encapsulator:$micro_utils_version"
|
api "dev.inmo:micro_utils.serialization.encapsulator:$micro_utils_version"
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
package dev.inmo.tgbotapi.types.passport
|
package dev.inmo.tgbotapi.types.passport
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.crypto.MD5
|
||||||
|
import dev.inmo.micro_utils.crypto.md5
|
||||||
import dev.inmo.micro_utils.serialization.base64.Base64StringSerializer
|
import dev.inmo.micro_utils.serialization.base64.Base64StringSerializer
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.*
|
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.*
|
||||||
@ -13,6 +15,9 @@ import kotlinx.serialization.encoding.Decoder
|
|||||||
import kotlinx.serialization.encoding.Encoder
|
import kotlinx.serialization.encoding.Encoder
|
||||||
import kotlinx.serialization.json.*
|
import kotlinx.serialization.json.*
|
||||||
|
|
||||||
|
val ByteArray.passportFileHash: MD5
|
||||||
|
get() = md5()
|
||||||
|
|
||||||
@Serializable(PassportElementErrorSerializer::class)
|
@Serializable(PassportElementErrorSerializer::class)
|
||||||
sealed class PassportElementError {
|
sealed class PassportElementError {
|
||||||
abstract val source: String
|
abstract val source: String
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
package dev.inmo.tgbotapi.types.passport
|
||||||
|
|
||||||
|
import dev.inmo.micro_utils.crypto.MD5
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
val File.passportFileHash: MD5
|
||||||
|
get() = readBytes().passportFileHash
|
Loading…
Reference in New Issue
Block a user