Author | SHA1 | Message | Date |
---|---|---|---|
Marko |
afc4d7a61f
|
libs/common: refactor libs/common 2 (#4231)
* libs/common: refactor libs/common 2 - move random function to there own pkg Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * change imports and usage throughout repo * fix goimports * add changelog entry |
5 years ago |
ValarDragon | be642754f5 |
libs/cmn/writefileatomic: Handle file already exists gracefully (#2113)
This uses the stdlib's method of creating a tempfile in our write file atomimc method, with a few modifications. We use a 64 bit number rather than 32 bit, and therefore a corresponding LCG. This is to reduce collision probability. (Note we currently used 32 bytes previously, so this is likely a concern) We handle reseeding the LCG in such a way that multiple threads are even less likely to reuse the same seed. |
7 years ago |