| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:convert'; | 5 import 'dart:convert'; |
| 6 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
| 7 | 7 |
| 8 import 'digest.dart'; | 8 import 'digest.dart'; |
| 9 import 'hash.dart'; | 9 import 'hash.dart'; |
| 10 import 'hash_sink.dart'; | 10 import 'hash_sink.dart'; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 /// [rfc]: https://tools.ietf.org/html/rfc1321 | 25 /// [rfc]: https://tools.ietf.org/html/rfc1321 |
| 26 /// | 26 /// |
| 27 /// **Warning**: MD5 has known collisions and should only be used when required | 27 /// **Warning**: MD5 has known collisions and should only be used when required |
| 28 /// for backwards compatibility. | 28 /// for backwards compatibility. |
| 29 /// | 29 /// |
| 30 /// Note that it's almost always easier to use [md5] rather than creating a new | 30 /// Note that it's almost always easier to use [md5] rather than creating a new |
| 31 /// instance. | 31 /// instance. |
| 32 class MD5 extends Hash { | 32 class MD5 extends Hash { |
| 33 final int blockSize = 16 * bytesPerWord; | 33 final int blockSize = 16 * bytesPerWord; |
| 34 | 34 |
| 35 @Deprecated("Use the md5 field instead.") | 35 /// This constructor is deprecated. |
| 36 /// |
| 37 /// Use [md5] instead. |
| 38 @Deprecated("Will be removed in crypto 1.0.0.") |
| 36 MD5(); | 39 MD5(); |
| 37 | 40 |
| 38 MD5 newInstance() => new MD5(); | 41 MD5 newInstance() => new MD5(); |
| 39 | 42 |
| 40 ByteConversionSink startChunkedConversion(Sink<Digest> sink) => | 43 ByteConversionSink startChunkedConversion(Sink<Digest> sink) => |
| 41 new ByteConversionSink.from(new _MD5Sink(sink)); | 44 new ByteConversionSink.from(new _MD5Sink(sink)); |
| 42 } | 45 } |
| 43 | 46 |
| 44 /// Data from a non-linear mathematical function that functions as | 47 /// Data from a non-linear mathematical function that functions as |
| 45 /// reproducible noise. | 48 /// reproducible noise. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 _shiftAmounts[i])); | 121 _shiftAmounts[i])); |
| 119 a = temp; | 122 a = temp; |
| 120 } | 123 } |
| 121 | 124 |
| 122 digest[0] = add32(a, digest[0]); | 125 digest[0] = add32(a, digest[0]); |
| 123 digest[1] = add32(b, digest[1]); | 126 digest[1] = add32(b, digest[1]); |
| 124 digest[2] = add32(c, digest[2]); | 127 digest[2] = add32(c, digest[2]); |
| 125 digest[3] = add32(d, digest[3]); | 128 digest[3] = add32(d, digest[3]); |
| 126 } | 129 } |
| 127 } | 130 } |
| OLD | NEW |