summaryrefslogtreecommitdiff
path: root/plugin/src/main/kotlin/moe/nea/archenemy/util/DigestUtils.kt
diff options
context:
space:
mode:
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.kt14
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