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

Side by Side Diff: tests/lib/crypto/base64_test.dart

Issue 10456028: Add base 64 encoding to the crypto library utils. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« lib/crypto/crypto_utils.dart ('K') | « lib/crypto/crypto_vm.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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Library tag to allow the test to run on Dartium.
6 #library('base64_test');
7
8 #import("dart:crypto");
9
10 // Data from http://tools.ietf.org/html/rfc4648.
11 var inputs =
12 const [ '', 'f', 'fo', 'foo', 'foob', 'fooba', 'foobar' ];
13 var results =
14 const [ '', 'Zg==', 'Zm8=', 'Zm9v', 'Zm9vYg==', 'Zm9vYmE=', 'Zm9vYmFy' ];
Søren Gjesse 2012/05/30 13:40:08 There is a longer example in tests/standalone/cryp
Mads Ager (google) 2012/05/30 15:16:10 Thanks!
15
16 void main() {
17 for (var i = 0; i < inputs.length; i++) {
18 var enc = CryptoUtils.bytesToBase64(inputs[i].charCodes());
19 Expect.equals(results[i], enc);
20 }
21 }
OLDNEW
« lib/crypto/crypto_utils.dart ('K') | « lib/crypto/crypto_vm.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698