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

Side by Side Diff: lib/src/hash_sink.dart

Issue 1359993003: Fix invocations of the MD5 constructors. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | lib/src/md5.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 library crypto.hash_base; 5 library crypto.hash_base;
6 6
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 8
9 import 'package:typed_data/typed_data.dart'; 9 import 'package:typed_data/typed_data.dart';
10 10
11 import 'digest.dart'; 11 import 'digest.dart';
12 import 'hash.dart';
13 import 'utils.dart'; 12 import 'utils.dart';
14 13
15 /// A base class for [Sink] implementations for hash algorithms. 14 /// A base class for [Sink] implementations for hash algorithms.
16 /// 15 ///
17 /// Subclasses should override [updateHash] and [digest]. 16 /// Subclasses should override [updateHash] and [digest].
18 abstract class HashSink implements Sink<List<int>> { 17 abstract class HashSink implements Sink<List<int>> {
19 /// The inner sink that this should forward to. 18 /// The inner sink that this should forward to.
20 final Sink<Digest> _sink; 19 final Sink<Digest> _sink;
21 20
22 /// Whether the hash function operates on big-endian words. 21 /// Whether the hash function operates on big-endian words.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // hash. 130 // hash.
132 var offset = _pendingData.length; 131 var offset = _pendingData.length;
133 _pendingData.addAll(new Uint8List(8)); 132 _pendingData.addAll(new Uint8List(8));
134 _pendingData.buffer.asByteData().setUint64(offset, lengthInBits, _endian); 133 _pendingData.buffer.asByteData().setUint64(offset, lengthInBits, _endian);
135 } 134 }
136 135
137 /// Rounds [val] up to the next multiple of [n], as long as [n] is a power of 136 /// Rounds [val] up to the next multiple of [n], as long as [n] is a power of
138 /// two. 137 /// two.
139 int _roundUp(int val, int n) => (val + n - 1) & -n; 138 int _roundUp(int val, int n) => (val + n - 1) & -n;
140 } 139 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/md5.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698