Skip to content

Commit 8c22a3e

Browse files
committedMar 28, 2016
Use BASE64 from package:convert.
Closes dart-lang/web_socket_channel#4 R=kevmoo@google.com Review URL: https://codereview.chromium.org//1834343003 .
1 parent e8bb6fb commit 8c22a3e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
 

‎pkgs/web_socket_channel/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.2
2+
3+
* Properly use `BASE64` from `dart:convert` rather than `crypto`.
4+
15
## 1.0.1
26

37
* Add support for `crypto` 1.0.0.

‎pkgs/web_socket_channel/lib/src/channel.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'dart:async';
6+
import 'dart:convert' as convert;
67

78
import 'package:async/async.dart';
89
import 'package:crypto/crypto.dart';
@@ -64,7 +65,8 @@ class WebSocketChannel extends StreamChannelMixin {
6465
static String signKey(String key) {
6566
// We use [codeUnits] here rather than UTF-8-decoding the string because
6667
// [key] is expected to be base64 encoded, and so will be pure ASCII.
67-
return BASE64.encode(sha1.convert((key + webSocketGUID).codeUnits).bytes);
68+
return convert.BASE64.encode(
69+
sha1.convert((key + webSocketGUID).codeUnits).bytes);
6870
}
6971

7072
/// Creates a new WebSocket handling messaging across an existing [channel].

‎pkgs/web_socket_channel/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: web_socket_channel
2-
version: 1.0.1
2+
version: 1.0.2
33
description: StreamChannel wrappers for WebSockets.
44
author: Dart Team <misc@dartlang.org>
55
homepage: https://github.com/dart-lang/web_socket_channel
66

77
environment:
8-
sdk: '>=1.8.0 <2.0.0'
8+
sdk: '>=1.13.0 <2.0.0'
99

1010
dependencies:
1111
async: '^1.3.0'

0 commit comments

Comments
 (0)