Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated breaking change on "String.charCodes".

Change:
str.charCodes() -> str.charCode

More info see breaking change note by Florian:
https://groups.google.com/a/dartlang.org/d/topic/misc/CH1S5UyjYJU/discussion
  • Loading branch information...
commit 74066bf85faaf7cde89fc67c4c546829f6111056 1 parent 6a13698
@Scorpiion authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 xml/ch03.xml
View
10 xml/ch03.xml
@@ -122,7 +122,7 @@ for (var char in 'hello'.splitChars()) {
assert('Never odd or even'.charCodeAt(0) == 78);
// Get all the char codes as a list of integers.
-var charCodes = 'Never odd or even'.charCodes();
+var charCodes = 'Never odd or even'.charCodes;
assert(charCodes.length == 17);
assert(charCodes[0] == 78);</screen>
</sect3>
@@ -2421,7 +2421,7 @@ main() {
main() {
var sha256 = new SHA256();
- var digest = sha256.update('message'.charCodes()).digest();
+ var digest = sha256.update('message'.charCodes).digest();
var hexString = CryptoUtils.bytesToHex(digest);
assert(hexString ==
'ab530a13e45914982b79f9b7e3fba994cfd1f3fb22f71cea1afbf02b460c6d1d');
@@ -2440,8 +2440,8 @@ main() {
<screen>import 'dart:crypto';
main() {
- var hmac = new HMAC(new SHA256(), 'secretkey'.charCodes());
- var hmacDigest = hmac.update('message'.charCodes()).digest();
+ var hmac = new HMAC(new SHA256(), 'secretkey'.charCodes);
+ var hmacDigest = hmac.update('message'.charCodes).digest();
var hmacHex = CryptoUtils.bytesToHex(hmacDigest);
assert(hmacHex ==
'5c3e2f56de9411068f675ef32ffa12735210b9cbfee2ba521367a3955334a343');
@@ -2480,4 +2480,4 @@ main() {
in Dart’s built-in libraries. You can use the pub tool, discussed in the
next chapter, to install additional Dart libraries.</para>
</sect1>
-</chapter>
+</chapter>
Please sign in to comment.
Something went wrong with that request. Please try again.