Fix `Int64.toRadixStringUnsigned` extra leading digits (#926) Currently `Int64.toRadixStringUnsigned` adds an extra '0' when the result is single digit, e.g. '02' instead of '2'. To be able to use the standard library `toRadixString`, we split the number into two halves, then calculate the lowest digit and the rest of the digits separately. With the lowest digit removed, the rest of the digits can be passed as a positive integer to `toRadixString`. The resulting strings are then concatenated to get the final result. The problem occurs when the number can be printed as a single digit. In this case the rest of the number is printed as '0', giving us e.g. '02' instead of '2'. To fix, we return early by calling the standard library `toRadixString` when the number is positive. This works because - The problem is only when printing single digits (as the lowest digit and the rest are printed separately, and the problem is when the "rest" part is 0) - Single-digit numbers need to have high 32-bits as zero (otherwise they'll be negative and printed as many digits, or positive but larger than single digit). - When the high 32-bits are all zero, the number is positive, and can be converted to string directly with the standard library signed `toRadixString`.
This repository is home to various Dart packages under the dart.dev publisher.
| Package | Description | Issues | Version |
|---|---|---|---|
| args | Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options. | ||
| async | Utility functions and classes related to the ‘dart:async’ library. | ||
| characters | String replacement with operations that are Unicode/grapheme cluster aware. | ||
| collection | Collections and utilities functions and classes related to collections. | ||
| convert | Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types. | ||
| crypto | Implementations of SHA, MD5, and HMAC cryptographic functions. | ||
| fixnum | Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes. | ||
| lints | Official Dart lint rules. Defines the ‘core’ and ‘recommended’ set of lints suggested by the Dart team. | ||
| logging | Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger. | ||
| os_detect | Platform independent OS detection. | ||
| path | A string-based path manipulation library. | ||
| platform | A pluggable, mockable platform information abstraction for Dart. | ||
| typed_data | Utility functions and classes related to the dart:typed_data library. |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
For additional information about contributing, see our contributing page.