Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: crypto/random.h

Issue 6873156: Move crypto_helpers from sync to base (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Correct headers. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: crypto/random.h
diff --git a/crypto/random.h b/crypto/random.h
new file mode 100644
index 0000000000000000000000000000000000000000..79915a091fe35d6084571d9222516e0a0e04073a
--- /dev/null
+++ b/crypto/random.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CRYPTO_RANDOM_H_
+#define CRYPTO_RANDOM_H_
+#pragma once
+
+#include <string>
+
+// GetRandomBytes fills |output_length| bytes of |output| with
+// cryptographically strong random data.
+void GetRandomBytes(void* output, size_t output_length);
Ryan Sleevi 2011/04/27 02:32:24 This makes the third implementation to get random
wtc 2011/04/28 19:42:22 GetRandomBytes should be moved to base/rand_util.h
+
+// Generate128BitRandomBase64String returns a string of length 22 containing
+// cryptographically strong random data encoded in base64.
+std::string Generate128BitRandomBase64String();
wtc 2011/04/28 19:42:22 API design issue: this function is not generally u
abarth-chromium 2011/04/29 07:47:11 http://codereview.chromium.org/6904118/ contains a
wtc 2011/04/29 18:07:08 abarth: yes. Your RandString function is equivale
+
+#endif // CRYPTO_RANDOM_H_

Powered by Google App Engine
This is Rietveld 408576698