mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-07-04 09:50:43 +02:00
Unnecessary Regex compile
This commit is contained in:
@ -26,8 +26,6 @@ fun HexKey.toDisplayHexKey(): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun decodePublicKey(key: String): ByteArray {
|
fun decodePublicKey(key: String): ByteArray {
|
||||||
val pattern = Pattern.compile(".+@.+\\.[a-z]+")
|
|
||||||
|
|
||||||
return if (key.startsWith("nsec")) {
|
return if (key.startsWith("nsec")) {
|
||||||
Persona(privKey = key.bechToBytes()).pubKey
|
Persona(privKey = key.bechToBytes()).pubKey
|
||||||
} else if (key.startsWith("npub")) {
|
} else if (key.startsWith("npub")) {
|
||||||
|
Reference in New Issue
Block a user