Get the api docs generated for the crypto package
Then library name of dart.crypto caused the api docs to not be generated.
Removed some abstract modifiers and class HashException
R=floitsch@google.com
BUG=
Review URL: https://codereview.chromium.org//16410007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/crypto@23693 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/lib/crypto.dart b/lib/crypto.dart
index 1b764ae..dad8211 100644
--- a/lib/crypto.dart
+++ b/lib/crypto.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library dart.crypto;
+library crypto;
import 'dart:math';
@@ -56,14 +56,14 @@
/**
* SHA1 hash function implementation.
*/
-abstract class SHA1 implements Hash {
+class SHA1 implements Hash {
factory SHA1() => new _SHA1();
}
/**
* SHA256 hash function implementation.
*/
-abstract class SHA256 implements Hash {
+class SHA256 implements Hash {
factory SHA256() => new _SHA256();
}
@@ -73,7 +73,7 @@
* WARNING: MD5 has known collisions and should only be used when
* required for backwards compatibility.
*/
-abstract class MD5 implements Hash {
+class MD5 implements Hash {
factory MD5() => new _MD5();
}
@@ -84,7 +84,7 @@
* [close] methods are used to extract the message authentication code.
*/
// TODO(floitsch): make Hash implement Sink, EventSink or similar.
-abstract class HMAC {
+class HMAC {
/**
* Create an [HMAC] object from a [Hash] and a key.
*/
@@ -122,7 +122,7 @@
/**
* Utility methods for working with message digests.
*/
-abstract class CryptoUtils {
+class CryptoUtils {
/**
* Convert a list of bytes (for example a message digest) into a hex
* string.
@@ -169,14 +169,3 @@
return _CryptoUtils.base64StringToBytes(input, ignoreInvalidCharacters);
}
}
-
-/**
- * HashExceptions are thrown on invalid use of a Hash
- * object.
- */
-class HashException {
- HashException(String this.message);
- toString() => "HashException: $message";
- String message;
-}
-
diff --git a/lib/src/crypto_utils.dart b/lib/src/crypto_utils.dart
index e08bbdd..18bb09e 100644
--- a/lib/src/crypto_utils.dart
+++ b/lib/src/crypto_utils.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.crypto;
+part of crypto;
abstract class _CryptoUtils {
static String bytesToHex(List<int> bytes) {
diff --git a/lib/src/hash_utils.dart b/lib/src/hash_utils.dart
index 4188c52..713dbb9 100644
--- a/lib/src/hash_utils.dart
+++ b/lib/src/hash_utils.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.crypto;
+part of crypto;
// Constants.
const _MASK_8 = 0xff;
@@ -33,7 +33,7 @@
// Update the hasher with more data.
add(List<int> data) {
if (_digestCalled) {
- throw new HashException(
+ throw new StateError(
'Hash update method called after digest was retrieved');
}
_lengthInBytes += data.length;
diff --git a/lib/src/hmac.dart b/lib/src/hmac.dart
index 794746d..2d07cff 100644
--- a/lib/src/hmac.dart
+++ b/lib/src/hmac.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.crypto;
+part of crypto;
class _HMAC implements HMAC {
bool _isClosed = false;
diff --git a/lib/src/md5.dart b/lib/src/md5.dart
index 7763832..279db3d 100644
--- a/lib/src/md5.dart
+++ b/lib/src/md5.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.crypto;
+part of crypto;
// The MD5 hasher is used to compute an MD5 message digest.
class _MD5 extends _HashBase implements MD5 {
diff --git a/lib/src/sha1.dart b/lib/src/sha1.dart
index 8ee28ce..79a23e3 100644
--- a/lib/src/sha1.dart
+++ b/lib/src/sha1.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.crypto;
+part of crypto;
// The SHA1 hasher is used to compute an SHA1 message digest.
class _SHA1 extends _HashBase implements SHA1 {
diff --git a/lib/src/sha256.dart b/lib/src/sha256.dart
index 3df0ffd..6dd198e 100644
--- a/lib/src/sha256.dart
+++ b/lib/src/sha256.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of dart.crypto;
+part of crypto;
// The SHA256 hasher is used to compute an SHA256 message digest.
class _SHA256 extends _HashBase implements SHA256 {
diff --git a/pubspec.yaml b/pubspec.yaml
index cc3c47d..3fd7917 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,6 @@
name: crypto
author: "Dart Team <misc@dartlang.org>"
homepage: http://www.dartlang.org
+documentation: http://api.dartlang.org/docs/pkg/crypto
description: >
Library of cryptographic functions.