a lib for common  algorithm