forked from openrs2/openrs2
parent
98dcbedeaf
commit
46b311c5ad
@ -0,0 +1,11 @@ |
|||||||
|
package org.openrs2.crypto |
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.module.SimpleModule |
||||||
|
import javax.inject.Singleton |
||||||
|
|
||||||
|
@Singleton |
||||||
|
public class CryptoJacksonModule : SimpleModule() { |
||||||
|
init { |
||||||
|
addSerializer(XteaKey::class.java, XteaKeySerializer) |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package org.openrs2.crypto |
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator |
||||||
|
import com.fasterxml.jackson.databind.SerializerProvider |
||||||
|
import com.fasterxml.jackson.databind.ser.std.StdSerializer |
||||||
|
|
||||||
|
public object XteaKeySerializer : StdSerializer<XteaKey>(XteaKey::class.java) { |
||||||
|
override fun serialize(value: XteaKey, gen: JsonGenerator, provider: SerializerProvider) { |
||||||
|
gen.writeStartArray() |
||||||
|
gen.writeNumber(value.k0) |
||||||
|
gen.writeNumber(value.k1) |
||||||
|
gen.writeNumber(value.k2) |
||||||
|
gen.writeNumber(value.k3) |
||||||
|
gen.writeEndArray() |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue