You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Mnemonics is first touched, it performs an initialization of SecureRandom which is known to be slow.
While documenting this could be helpful, it doesn't give clients using this library a lot of options to work around it. That's because Mnemonics is an object, so initialization is effectively a JVM static initializer when means it runs as soon as something touches the object.
Possible alternative implementations:
Defer SecureRandom initialization until it is needed, giving clients better control over timing
Convert Mnemonics to a class, so that initialization happens during construction which allows clients better control over timing of the initialization
Create a companion object initializer. This could be a suspend function, allowing secure random injection into a private constructor for Mnemonics
... There may be other options to consider as well
The text was updated successfully, but these errors were encountered:
When Mnemonics is first touched, it performs an initialization of
SecureRandom
which is known to be slow.While documenting this could be helpful, it doesn't give clients using this library a lot of options to work around it. That's because
Mnemonics
is an object, so initialization is effectively a JVM static initializer when means it runs as soon as something touches the object.Possible alternative implementations:
The text was updated successfully, but these errors were encountered: