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

Issue 10456028: Add base 64 encoding to the crypto library utils. (Closed)

Created:
8 years, 6 months ago by Mads Ager (google)
Modified:
8 years, 6 months ago
Reviewers:
Søren Gjesse
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add base 64 encoding to the crypto library utils. It is clearly useful for Crypto APIs. Whether or not we should move base64 encoding somewhere else can be discussed. However, at least it is available now. R=sgjesse@google.com BUG=dartbug.com/2458 TEST=tests/lib/crypto/base64_test.dart Committed: https://code.google.com/p/dart/source/detail?r=8108

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -0 lines) Patch
M lib/crypto/crypto.dart View 1 1 chunk +9 lines, -0 lines 0 comments Download
M lib/crypto/crypto_utils.dart View 1 2 chunks +61 lines, -0 lines 0 comments Download
M lib/crypto/crypto_vm.dart View 1 1 chunk +9 lines, -0 lines 0 comments Download
A tests/lib/crypto/base64_test.dart View 1 1 chunk +55 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (google)
8 years, 6 months ago (2012-05-30 13:28:33 UTC) #1
Søren Gjesse
LGTM with line breaking fixed. http://codereview.chromium.org/10456028/diff/1/lib/crypto/crypto_utils.dart File lib/crypto/crypto_utils.dart (right): http://codereview.chromium.org/10456028/diff/1/lib/crypto/crypto_utils.dart#newcode34 lib/crypto/crypto_utils.dart:34: result.add(table[b2 & 0x3f]); You ...
8 years, 6 months ago (2012-05-30 13:40:08 UTC) #2
Mads Ager (google)
8 years, 6 months ago (2012-05-30 15:16:10 UTC) #3
http://codereview.chromium.org/10456028/diff/1/lib/crypto/crypto_utils.dart
File lib/crypto/crypto_utils.dart (right):

http://codereview.chromium.org/10456028/diff/1/lib/crypto/crypto_utils.dart#n...
lib/crypto/crypto_utils.dart:34: result.add(table[b2 & 0x3f]);
On 2012/05/30 13:40:08, Søren Gjesse wrote:
> You need to insert \r\n for at least every 76 characters (57 bytes or 19
> blocks). RFC 2045 page 24 says "The encoded output stream must be represented
in
> lines of no more than 76 characters each".

http://tools.ietf.org/html/rfc4648

explicitly says in section 3.1 that implementations MUST NOT add line feeds
unless explicitly stated so. I'll add an optional parameter 'lineLength' which
can be used to specify the 76 char line length if used for MIME.

http://codereview.chromium.org/10456028/diff/1/tests/lib/crypto/base64_test.dart
File tests/lib/crypto/base64_test.dart (right):

http://codereview.chromium.org/10456028/diff/1/tests/lib/crypto/base64_test.d...
tests/lib/crypto/base64_test.dart:14: const [ '', 'Zg==', 'Zm8=', 'Zm9v',
'Zm9vYg==', 'Zm9vYmE=', 'Zm9vYmFy' ];
On 2012/05/30 13:40:08, Søren Gjesse wrote:
> There is a longer example in tests/standalone/crypto/base64_test.dart

Thanks!

Powered by Google App Engine
This is Rietveld 408576698