docs: fix typo and add link

pull/1902/head
Xwite 3 years ago
parent 123b9aacf2
commit 4c97e17ac4
  1. 5
      app/src/main/assets/help/jsHelp.md
  2. 6
      app/src/main/java/io/legado/app/utils/DigestUtils.kt
  3. 3
      app/src/main/java/io/legado/app/utils/EncoderUtils.kt

@ -133,6 +133,7 @@ deleteFile(path: String)
**** ****
> [常见加密解密算法介绍](https://www.yijiyong.com/algorithm/encryption/01-intro.html) > [常见加密解密算法介绍](https://www.yijiyong.com/algorithm/encryption/01-intro.html)
> [相关概念](https://blog.csdn.net/OrangeJack/article/details/82913804) > [相关概念](https://blog.csdn.net/OrangeJack/article/details/82913804)
> [Android支持的transformation](https://developer.android.google.cn/reference/kotlin/javax/crypto/Cipher?hl=en)
* AES * AES
> transformation默认实现AES/ECB/PKCS5Padding > transformation默认实现AES/ECB/PKCS5Padding
``` ```
@ -163,14 +164,14 @@ java.tripleDESEncodeBase64Str(data: String,key: String,mode: String,padding: Str
java.tripleDESDecodeStr(data: String,key: String,mode: String,padding: String,iv: String): String? java.tripleDESDecodeStr(data: String,key: String,mode: String,padding: String,iv: String): String?
``` ```
* 摘要 * 摘要
> algorithm支持MD2 MD5 SHA-1 SHA-256 SHA-384 SHA-512 > algorithm支持MD5 SHA-1 SHA-224 SHA-256 SHA-384 SHA-512
``` ```
java.digestHex(data: String, algorithm: String,): String? java.digestHex(data: String, algorithm: String,): String?
java.digestBase64Str(data: String, algorithm: String,): String? java.digestBase64Str(data: String, algorithm: String,): String?
``` ```
* HMac(散列消息鉴别码) * HMac(散列消息鉴别码)
> algorithm支持HmacMD5 HmacSHA1 HmacSHA224 HmacSHA256 HmacSHA384 HmacSHA512 > algorithm支持DESMAC DESMAC/CFB8 DESedeMAC DESedeMAC/CFB8 DESedeMAC64 DESwithISO9797 HmacMD5 HmacSHA* ISO9797ALG3MAC PBEwithSHA*
``` ```
java.HMacHex(data: String, algorithm: String, key: String): String java.HMacHex(data: String, algorithm: String, key: String): String

@ -9,7 +9,8 @@ object DigestUtils {
/** /**
* 消息摘要 * 消息摘要
* MD2 MD5 SHA-1 SHA-256 SHA-384 SHA-512 * 支持MD5 SHA-1 SHA-224 SHA-256 SHA-384 SHA-512
* https://developer.android.google.cn/reference/java/security/MessageDigest?hl=en
*/ */
fun getDigest( fun getDigest(
algorithm: String, algorithm: String,
@ -36,7 +37,8 @@ object DigestUtils {
/** /**
* 散列消息鉴别码 * 散列消息鉴别码
* HmacMD5 HmacSHA1 HmacSHA224 HmacSHA256 HmacSHA384 HmacSHA512 * 支持DESMAC DESMAC/CFB8 DESedeMAC DESedeMAC/CFB8 DESedeMAC64 DESwithISO9797 HmacMD5 HmacSHA* ISO9797ALG3MAC PBEwithSHA*
* https://developer.android.google.cn/reference/kotlin/javax/crypto/Mac?hl=en
*/ */
fun getHMac( fun getHMac(
algorithm: String, algorithm: String,

@ -6,6 +6,9 @@ import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec import javax.crypto.spec.SecretKeySpec
/**
* transformations https://developer.android.google.cn/reference/kotlin/javax/crypto/Cipher?hl=en
*/
@Suppress("unused") @Suppress("unused")
object EncoderUtils { object EncoderUtils {

Loading…
Cancel
Save