diff options
author | Gil <mcg@google.com> | 2017-11-27 12:05:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-27 12:05:23 -0800 |
commit | 8c4cd9d5413e7f458001016e5faace2b610a69ce (patch) | |
tree | 61f1ff95d2f9b830fbcf3e32aff0472cf7f779c6 /Firestore/Source/Util | |
parent | 782408ff5850027898ebb0f9d16cbda8272e0d32 (diff) |
Change FSTExponentialBackoff to use firestore::SecureRandom directly (#492)
* Migrate FSTExponentialBackoff to Objective-C++
* Change FSTExponentialBackoff to use firestore::SecureRandom directly
Diffstat (limited to 'Firestore/Source/Util')
-rw-r--r-- | Firestore/Source/Util/FSTUtil.h | 3 | ||||
-rw-r--r-- | Firestore/Source/Util/FSTUtil.m | 6 |
2 files changed, 0 insertions, 9 deletions
diff --git a/Firestore/Source/Util/FSTUtil.h b/Firestore/Source/Util/FSTUtil.h index 3985d10..230c72a 100644 --- a/Firestore/Source/Util/FSTUtil.h +++ b/Firestore/Source/Util/FSTUtil.h @@ -20,9 +20,6 @@ NS_ASSUME_NONNULL_BEGIN @interface FSTUtil : NSObject -/** Generates a random double between 0 and 1. */ -+ (double)randomDouble; - /** Generates a random ID suitable for use as a document ID. */ + (NSString *)autoID; diff --git a/Firestore/Source/Util/FSTUtil.m b/Firestore/Source/Util/FSTUtil.m index a25cd7e..47a8821 100644 --- a/Firestore/Source/Util/FSTUtil.m +++ b/Firestore/Source/Util/FSTUtil.m @@ -18,18 +18,12 @@ NS_ASSUME_NONNULL_BEGIN -static const double kArc4RandomMax = 0x100000000; - static const int kAutoIDLength = 20; static NSString *const kAutoIDAlphabet = @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; @implementation FSTUtil -+ (double)randomDouble { - return ((double)arc4random() / kArc4RandomMax); -} - + (NSString *)autoID { unichar autoID[kAutoIDLength]; for (int i = 0; i < kAutoIDLength; i++) { |