diff options
author | Linnea Gräf <nea@nea.moe> | 2023-12-10 16:54:57 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2023-12-10 16:54:57 +0100 |
commit | 0936f6272c7d1e41b7e9550bb17fe84af5d976c3 (patch) | |
tree | 0c41488910659eefb31a6231dce0f72f29ca75e3 /plugin/src/main/kotlin/moe/nea/archenemy/util/DigestUtils.kt | |
parent | 17f0faaccb0db837a64b6ce7cecff7f8ab048410 (diff) | |
download | archenemy-0936f6272c7d1e41b7e9550bb17fe84af5d976c3.tar.gz archenemy-0936f6272c7d1e41b7e9550bb17fe84af5d976c3.tar.bz2 archenemy-0936f6272c7d1e41b7e9550bb17fe84af5d976c3.zip |
Move utilities around
Diffstat (limited to 'plugin/src/main/kotlin/moe/nea/archenemy/util/DigestUtils.kt')
-rw-r--r-- | plugin/src/main/kotlin/moe/nea/archenemy/util/DigestUtils.kt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugin/src/main/kotlin/moe/nea/archenemy/util/DigestUtils.kt b/plugin/src/main/kotlin/moe/nea/archenemy/util/DigestUtils.kt new file mode 100644 index 0000000..4f50000 --- /dev/null +++ b/plugin/src/main/kotlin/moe/nea/archenemy/util/DigestUtils.kt @@ -0,0 +1,14 @@ +package moe.nea.archenemy.util + +import java.security.MessageDigest + +fun MessageDigest.updateField(text: String, value: String) { + this.update(text) + this.update(":") + this.update(value) + this.update(";") +} + +fun MessageDigest.update(text: String) { + this.update(text.encodeToByteArray()) +}
\ No newline at end of file |