Red enveloper (hongbao) generation algorithm like wechat