Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: square/luhnybin
base: master
...
head fork: jpedrosa/luhnybin
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
Commits on Nov 16, 2011
@jpedrosa jpedrosa One Ruby version. c6bde33
@jpedrosa jpedrosa Added sample data. 6731c1c
@jpedrosa jpedrosa More generic call to environment Ruby. fd1c36c
@jpedrosa jpedrosa Initial support for a Dart implementation. 4951657
@jpedrosa jpedrosa Little improvement to the Ruby version based on similar change to the…
… Dart version.
ec2bb7e
@jpedrosa jpedrosa Finished the first version of the Dart implementation.
It has been implemented following the ideas of the Ruby version.

The Dart version is a little under 10x slower than the Ruby version.

The Dart version does some more work during the mask method because
of some lack of support for matching a RegExp after a certain position
on a string.
8880bed
@jpedrosa jpedrosa Improved the Dart coding style. 368365d
Commits on Nov 17, 2011
@jpedrosa jpedrosa Done some experiments on a new Dart version.
For now, just refactored the testIt method.
1f1190a
@jpedrosa jpedrosa Refactored testId in the new Dart version to use a lookup table for d…
…igits.
a14c7b8
@jpedrosa jpedrosa Replaced a couple of digit regexes with table lookups. fb425e3
@jpedrosa jpedrosa Removed another dependency on regexp for the new Dart version. 8e80d69
@jpedrosa jpedrosa Just loaded the scanned digits into a variable in the mask method. 6ac3934
@jpedrosa jpedrosa Small fix. 83a284c
@jpedrosa jpedrosa Created a broader match of targets, preparing for more refactoring of…
… the mask method.
faf1393
@jpedrosa jpedrosa One more tweak following broad matches. e77cd75
@jpedrosa jpedrosa More refactoring of mask. 7de91d6
@jpedrosa jpedrosa More work on refactoring mask. a0dd46c
@jpedrosa jpedrosa Moved a few lines around in mask. 17db623
@jpedrosa jpedrosa Let's refactor mask for real, soon. 727b9bf
@jpedrosa jpedrosa Finished refactoring the mask method of the new Dart version.
Now it's fast enough!
b2060c8
@jpedrosa jpedrosa Small tweak. 64b6cca
@jpedrosa jpedrosa Moved the first version of Dart into an "old" file.
Making room to move the new Dart version into the original file.
de646b9
@jpedrosa jpedrosa Moved the new Dart version into the original file. 2105715
@jpedrosa jpedrosa Some more refactoring of the new Dart version. 2b78863
@jpedrosa jpedrosa Removed unnecessary variable from the Dart version. aadda05
@jpedrosa jpedrosa Improved the Dart version some more. 2bd13b3
@jpedrosa jpedrosa Start a new Ruby version based on the new Dart version. 074eb87
@jpedrosa jpedrosa Refactored Ruby's test_it. f4d35e9
@jpedrosa jpedrosa Finished creating the new Ruby version based on the new Dart version. becadaa
@jpedrosa jpedrosa Merge https://github.com/square/luhnybin a2ae2fb
Commits on Nov 18, 2011
@jpedrosa jpedrosa Just some code style change to the Dart version. 77aca80
@jpedrosa jpedrosa Changed the Dart coding style some more. 688c2d9
Commits on Nov 19, 2011
@jpedrosa jpedrosa Stopped using getRange from the iterate method in the Dart version.
Performance is a little better now.
eb42b8e
@jpedrosa jpedrosa Stopped using range from the Ruby version of iterate as well. 7251d73
@jpedrosa jpedrosa Stopped using getRange calls from the mask method as well in the Dart…
… version.
5b63bf9
@jpedrosa jpedrosa Stopped using range from the mask method in the Ruby version as well. 0ee0d9a
@jpedrosa jpedrosa Added notes file. f4cdc89
@jpedrosa jpedrosa Small change to the notes file. b7b023a
@jpedrosa jpedrosa Renamed variable. d2aace8
@jpedrosa jpedrosa Small coding style change. 18a6d7b
@jpedrosa jpedrosa Fixed a bug during the masking in the Dart version. 081d3bf
@jpedrosa jpedrosa Fixed a bug during the masking of the Ruby version, following the sam…
…e bug fix for the Dart version.
74a072a
@jpedrosa jpedrosa Improved the Ruby coding style. 9d0556b
@jpedrosa jpedrosa Saved some function calls from the mask method. 5c06c83
@jpedrosa jpedrosa Improve variable name. 47c30d5
@jpedrosa jpedrosa Further optimized the Dart version.
Removed the DIGITS table and replaced it with char code checks.
3097bc3
@jpedrosa jpedrosa Updated notes to show how the Dart version has improved. 447592b
@jpedrosa jpedrosa Created a proper Luhn class for the Dart version. 81db09b
@jpedrosa jpedrosa Added a proper class to the Ruby version. a43b9f6
@jpedrosa jpedrosa Improve the constructor method of the Dart version. 3e83e25
@jpedrosa jpedrosa Some minimum type annotation to the methods of the Dart version. 526d543
@jpedrosa jpedrosa Created a simpler implementation of mask by using gsub.
It hasn't produced noticeable performance gains, but it did simplify
the coding a lot. I took the idea of using gsub from somebody else's
implementation.
06ed903
@jpedrosa jpedrosa Created a mask for the Ruby version by avoiding regexp altogether. 0201554
@jpedrosa jpedrosa Removed the mask methods that use regexp from the Ruby version.s cad0dac
Commits on Nov 20, 2011
@jpedrosa jpedrosa Also replaced the mask method dependent on regexp in the Dart version.
Following the lead of the Ruby version.
106ade8
@jpedrosa jpedrosa Improved the Dart coding style. 0a71afb
@jpedrosa jpedrosa Updated the Notes file to reflect the recent developments. 26396bb
@jpedrosa jpedrosa Removed the now real obsolete first versions of the Ruby and Dart imp…
…lementations.
c105893
@jpedrosa jpedrosa Added mask_offset to the masking in order to save some processing.
Thing is, 3 lines of code made a world of difference for the Ruby algorithm. It improved its performance 3 fold.
559fdb9
@jpedrosa jpedrosa Once again, updated the notes file to reflect the newest good news. 2f0a807
@jpedrosa jpedrosa Have had to fix a bug with the latest algorithm. This fixes it for th…
…e Ruby version.
5bdf9e8
@jpedrosa jpedrosa Also fixed the bug for the Dart version. 152c25b
@jpedrosa jpedrosa Update the notes file again to spell out what has changed. 2ea2350
@jpedrosa jpedrosa Documentation typo. 16d2f0b
@jpedrosa jpedrosa Added type annotation. c936dc1
@jpedrosa jpedrosa Small optimization improvement for the Ruby version. 6eb13ff
@jpedrosa jpedrosa Shortened the mask code by one line. 914ae29
Commits on Nov 21, 2011
@jpedrosa jpedrosa Merge https://github.com/square/luhnybin 201b905
@jpedrosa jpedrosa Fix Ruby version as per recently introduced test. c931c7c
@jpedrosa jpedrosa Fixed the Dart version as per the recently updated tests. cba798a
@jpedrosa jpedrosa Updated the notes file to talk about the recent changes. e0673ff
@jpedrosa jpedrosa I've ressurected the Ruby version based on RegExp as it performs bett…
…er than the current one.
1e575fd
@jpedrosa jpedrosa Updated the notes file again. fd94987
@jpedrosa jpedrosa Fix documentation typo. 27ba637
@jpedrosa jpedrosa Made the main Ruby implementation, the one without RegExp, to use arr…
…ays of chars instead.
ac13076
@jpedrosa jpedrosa Updated the notes file again. The main Ruby implementation is fast en…
…ough again.
17a3fd6
@jpedrosa jpedrosa Tried to match the new Ruby version in the Dart version by using more…
… char codes.
07743f2
@jpedrosa jpedrosa Updated notes again. The Dart version is shining. b74749a
@jpedrosa jpedrosa Added a version based on the Go programming language. e6db931
@jpedrosa jpedrosa Updated the notes file to talk about the recently added Go version. 48a1a59
@jpedrosa jpedrosa Improved the Go version a bit more. 7a01206
@jpedrosa jpedrosa When repeating just once masking the content of stdin, avoid extra ov…
…erhead.
710204b
@jpedrosa jpedrosa Added mega_sample to help with benchmarking. 8343f9a
@jpedrosa jpedrosa Created the equivalent of a class for the Go version. 8798704
Commits on Nov 22, 2011
@jpedrosa jpedrosa Performance tweak for the Go version. 9379dc4
@jpedrosa jpedrosa Enable some mask offset again. 4006540
@jpedrosa jpedrosa Updated the notes file. Ruby, Dart and Go all looking impressive. 6889086
@jpedrosa jpedrosa Small documentation typo. 4933147
@jpedrosa jpedrosa Added custom string reading for the Dart version to avoid issues with…
… the default StringInputStream implementation.
0f6e7e0
@jpedrosa jpedrosa Updated the notes file. Fixed an issue regarding the default StringIn…
…putStream.
39ac498
@jpedrosa jpedrosa Small fix to the Dart version. c0e6ab1
@jpedrosa jpedrosa Using even more char codes now in the Dart version. a7c95a8
@jpedrosa jpedrosa Updated the notes to mention the latest Dart version improvements. d59b696
Commits on Nov 23, 2011
@jpedrosa jpedrosa Small fix to the Ruby version. 6fc3670
@jpedrosa jpedrosa Improve type annotations of the Dart version. 77d6bdb
@jpedrosa jpedrosa Little improvement to the Dart version coding style. f80ad6a
@jpedrosa jpedrosa Some more improvement to the Dart coding style. ffa4be1
@jpedrosa jpedrosa Some more improvement to the Dart coding style. 0e56ac7
@jpedrosa jpedrosa Improved the Dart coding style some more. f8e60c8
Commits on Nov 24, 2011
@jpedrosa jpedrosa Small fix to the Dart version. 41085a7
Commits on Nov 27, 2011
@jpedrosa jpedrosa Optimized the Go version a little. e37fe36
Something went wrong with that request. Please try again.