1. 27 9月, 2013 1 次提交
  2. 26 9月, 2013 1 次提交
  3. 05 9月, 2013 1 次提交
  4. 07 8月, 2013 6 次提交
    • S
      Result::get -> Result::unwrap · 3b441c48
      Steven Fackler 提交于
      3b441c48
    • S
      Removed convenience encoding trait impls · e6176513
      Steven Fackler 提交于
      Encoding should really only be done from [u8]<->str. The extra
      convenience implementations don't really have a place, especially since
      they're so trivial.
      
      Also improved error messages in FromBase64.
      e6176513
    • S
      Removing space for NULL terminator · 858e1661
      Steven Fackler 提交于
      String NULL terminators are going away soon, so we may as well get rid
      of this now so it doesn't rot.
      858e1661
    • S
      ToBase64 and ToHex perf improvements · ff5fdffc
      Steven Fackler 提交于
      The overhead of str::push_char is high enough to cripple the performance
      of these two functions. I've switched them to build the output in a
      ~[u8] and then convert to a string later. Since we know exactly the
      bytes going into the vector, we can use the unsafe version to avoid the
      is_utf8 check.
      
      I could have riced it further with vec::raw::get, but it only added
      ~10MB/s so I didn't think it was worth it. ToHex is still ~30% slower
      than FromHex, which is puzzling.
      
      Before:
      
      ```
      test base64::test::from_base64 ... bench: 1000 ns/iter (+/- 349) = 204 MB/s
      test base64::test::to_base64 ... bench: 2390 ns/iter (+/- 1130) = 63 MB/s
      ...
      test hex::tests::bench_from_hex ... bench: 884 ns/iter (+/- 220) = 341 MB/s
      test hex::tests::bench_to_hex ... bench: 2453 ns/iter (+/- 919) = 61 MB/s
      ```
      
      After:
      
      ```
      test base64::test::from_base64 ... bench: 1271 ns/iter (+/- 600) = 160 MB/s
      test base64::test::to_base64 ... bench: 759 ns/iter (+/- 286) = 198 MB/s
      ...
      test hex::tests::bench_from_hex ... bench: 875 ns/iter (+/- 377) = 345 MB/s
      test hex::tests::bench_to_hex ... bench: 593 ns/iter (+/- 240) = 254 MB/s
      ```
      ff5fdffc
    • S
      Some minor hex changes · 463e2416
      Steven Fackler 提交于
      463e2416
    • S
      Added hexadecimal encoding module · 2266df51
      Steven Fackler 提交于
      FromHex ignores whitespace and parses either upper or lower case hex
      digits. ToHex outputs lower case hex digits with no whitespace. Unlike
      ToBase64, ToHex doesn't allow you to configure the output format. I
      don't feel that it's super useful in this case.
      2266df51