kotlin-hashids
kotlin-hashids copied to clipboard
java.lang.ArrayIndexOutOfBoundsException
Hi, I'm getting this error:
java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
at org.Hashids.guardIndex(Hashids.kt:88)
at org.Hashids.addGuardsIfNecessary(Hashids.kt:186)
at org.Hashids.encode(Hashids.kt:58)
Here is the code I which cause this issue:
val hashids = Hashids("Turbo Quiz, c'est fun !", 3)
val questionId = hashids.encode(0)
It works with a minimum length of 0, 1 and 2, but from 3 it raise this error
Edit: It seems that it occurs specifically when I'm trying to encode 0