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

Unified Diff: sdk/lib/crypto/crypto.dart

Issue 11293245: Make interfaces into abstract classes in 'dart:crypto'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | sdk/lib/crypto/crypto_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/crypto/crypto.dart
diff --git a/sdk/lib/crypto/crypto.dart b/sdk/lib/crypto/crypto.dart
index ff634928d102fc2db377eac627e68978c0664820..c8f9a0f5a9e724e5ce7ce4e37fc24b31cd9306ae 100644
--- a/sdk/lib/crypto/crypto.dart
+++ b/sdk/lib/crypto/crypto.dart
@@ -52,15 +52,15 @@ abstract class Hash {
/**
* SHA1 hash function implementation.
*/
-interface SHA1 extends Hash default _SHA1 {
- SHA1();
+abstract class SHA1 implements Hash {
+ factory SHA1() => new _SHA1();
}
/**
* SHA256 hash function implementation.
*/
-interface SHA256 extends Hash default _SHA256 {
- SHA256();
+abstract class SHA256 implements Hash {
+ factory SHA256() => new _SHA256();
}
/**
@@ -69,8 +69,8 @@ interface SHA256 extends Hash default _SHA256 {
* WARNING: MD5 has known collisions and should only be used when
* required for backwards compatibility.
*/
-interface MD5 extends Hash default _MD5 {
- MD5();
+abstract class MD5 implements Hash {
+ factory MD5() => new _MD5();
}
/**
@@ -79,11 +79,11 @@ interface MD5 extends Hash default _MD5 {
* The [update] method is used to add data to the message. The [digest] method
* is used to extract the message authentication code.
*/
-interface HMAC default _HMAC {
+abstract class HMAC {
/**
* Create an [HMAC] object from a [Hash] and a key.
*/
- HMAC(Hash hash, List<int> key);
+ factory HMAC(Hash hash, List<int> key) => new _HMAC();
/**
* Add a list of bytes to the message.
@@ -100,7 +100,7 @@ interface HMAC default _HMAC {
/**
* Utility methods for working with message digests.
*/
-class CryptoUtils {
+abstract class CryptoUtils {
/**
* Convert a list of bytes (for example a message digest) into a hex
* string.
« no previous file with comments | « no previous file | sdk/lib/crypto/crypto_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698