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

Unified Diff: lib/src/channel.dart

Issue 1834343003: Use BASE64 from package:convert. (Closed) Base URL: git@github.com:dart-lang/web_socket_channel.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/channel.dart
diff --git a/lib/src/channel.dart b/lib/src/channel.dart
index 3d1d4929994abe6c91c558b4405d7a34a66a5aa4..9c82c6867547c626be1990380c6819afd3dc977c 100644
--- a/lib/src/channel.dart
+++ b/lib/src/channel.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
+import 'dart:convert' as convert;
import 'package:async/async.dart';
import 'package:crypto/crypto.dart';
@@ -64,7 +65,8 @@ class WebSocketChannel extends StreamChannelMixin {
static String signKey(String key) {
// We use [codeUnits] here rather than UTF-8-decoding the string because
// [key] is expected to be base64 encoded, and so will be pure ASCII.
- return BASE64.encode(sha1.convert((key + webSocketGUID).codeUnits).bytes);
+ return convert.BASE64.encode(
+ sha1.convert((key + webSocketGUID).codeUnits).bytes);
}
/// Creates a new WebSocket handling messaging across an existing [channel].
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698