yomorun / hashids-java

Hashids algorithm v1.0.0 implementation in Java
http://hashids.org
MIT License
1.02k stars 155 forks source link

Thread safe? #9

Closed manikantag closed 10 years ago

manikantag commented 10 years ago

Is using once created new Hashids("this is my salt") (probably, as a static variable) is thread safe? or do we've to synchronize it manually?

Thanks.

ancane commented 10 years ago

From what I see, once Hashids instance constructed, encode/decode methods don't modify any class properties but only read them. This way all the calculations happen on thread's stack, so it's thread safe.

manikantag commented 10 years ago

Thanks. Closing the issue.