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

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

Issue 1350933002: Stop using parts. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Created 5 years, 3 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
« lib/src/hash_base.dart ('K') | « lib/src/sha256.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 library crypto.utils;
6
7 // Constants.
8 const MASK_8 = 0xff;
9 const MASK_32 = 0xffffffff;
10 const BITS_PER_BYTE = 8;
11 const BYTES_PER_WORD = 4;
12
13 // Helper methods.
14 int add32(x, y) => (x + y) & MASK_32;
15
16 int roundUp(val, n) => (val + n - 1) & -n;
17
18 // Helper functions used by more than one hasher.
19
20 // Rotate left limiting to unsigned 32-bit values.
21 int rotl32(int val, int shift) {
22 var mod_shift = shift & 31;
23 return ((val << mod_shift) & MASK_32) |
24 ((val & MASK_32) >> (32 - mod_shift));
25 }
OLDNEW
« lib/src/hash_base.dart ('K') | « lib/src/sha256.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698