Fcrand (Go language): drop-in replacement for crypto/rand, up to 10x faster
10 months ago
- #Go
- #cryptography
- #performance
- fcrand is a high-performance drop-in replacement for Go's crypto/rand.
- It offers up to 10x faster performance for random data requests ≤512 bytes while maintaining cryptographic security.
- 100% API compatible with crypto/rand, making it a true drop-in replacement.
- Thread-safe with zero configuration, same as crypto/rand.
- Install via `go get -u github.com/sdrapkin/fcrand` and import as `rand "github.com/sdrapkin/fcrand"`.
- FIPS-140 ready, with environment variable `GODEBUG=fips140=on`.
- Performance benchmarks show significant speedups for small requests, with fallback to crypto/rand levels at 512+ bytes.
- Includes additional methods like `.Text()` and `.Prime()` for enhanced functionality.