Skip to content

Commit

Permalink
Ready for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhng86 committed Feb 21, 2019
0 parents commit e538465
Show file tree
Hide file tree
Showing 36 changed files with 7,718 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Namespace name
2. Function name
3. Param type(s), 'If more than one value, please separate the values by a comma'.
4. Param's value(s). 'If more than one value, please put the values inside quotes and separate them by a comma'.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Runtime**
- OS: [e.g. Windows 10]
- Environment: [e.g. Browser, Nodejs v8.10.0]
- Browser [e.g. Mozilla Firefox 65.0]

**Additional context**
Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Describe a name that may be used as a function name for the feature that you requested.**
A none offensive name that may be used as the function name for the feature that you requested.

**Additional context**
Add any other context about the feature request here.
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at kevin@fai.host. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Khang Hoang Nguyen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# faiNumber-JS

faiNumber-JS is a numerical library for Javascript.

faiNumber-JS mainly deals with converting strings of number to number
type and numerically comparing strings.

This library is a safe library and will only parse values for strings
within the range of `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER`
(The safe range). For strings with values that outside of "the safe range",
this library will return undefined when parsing them to values of type
number.

Currently, faiNumber-JS supports converting numerical strings
of radix 2, 3, 8, 10, 16 to values of type number.

When it come to comparing integer strings beyond the safe range, this
library supports comparing strings of any length(bound by memory
limitation) of integer values of any radix between 2 to 36 without
needing to convert them to type number values.

faiNumber-JS library does support nodeJS and can be imported as modules
into nodeJS projects.

One of faiNumber-JS goals is to be able to provide support for all
numbering systems between 2 and 36. Future support for float is also
another goal of this library.

This library does not have any dependency and will maintain that way as
that is also one of this library goal.

This library does not remove any API that was released in any final
build versions without a notice spanning 3 major release versions.

Before using some of the methods of this library, it is recommended to
read the documentation for what they do before using them as some of the
methods of this library were built for expert usage. The previous is
especially true for any assume**** methods that provide by this library.

## Benchmark
<a href="https://github.com/kevinhng86/faiNumber-JS/blob/master/benchmark.md">Benchmark</a>

## Help
<a href="https://lib.fai.host/js/faiNumber/v1/">faiNumber's API Documentation</a>

## License
<a href="https://github.com/kevinhng86/faiNumber-JS/blob/master/LICENSE">MIT</a>
46 changes: 46 additions & 0 deletions benchmark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Benchmark

How fast is faiNumber?

The below are benchmark results for Base10Util.toNumber() of faiNumber
(v1.0.0.f) comparing to parseInt() and auto-cast. The benchmark test was
executed on 3 different browsers and also on NodeJS. Each test ran 3
times and the average result from all 3 runs is used as the result.
Results are in milliseconds and were rounded to the nearest value of 2
decimal placement. For the result, the lower is the better.

###### CPU: AMD® A10-7800 radeon r7, 12 compute cores 4c+8g × 4
###### OS: Ubuntu 18.04.1 LTS
<br>

##### Base10Util(Chrome 71.0.3578.98)
##### Parsed 500000 Strings
| | Length 1 | Length 10 | Length 16 |
|---|---|---|---|
| parseInt() | 14.67ms | 91.33ms | 241.33ms |
| toNumber() | 24.00ms | 53.00ms | 193.67ms |
| Auto-cast | 15.67ms | 101.33ms | 248.33ms |

##### Base10Util(Mozilla Firefox 65.0)
##### Parsed 500000 Strings
| | Length 1 | Length 10 | Length 16
|---|---|---|---|
| parseInt() | 14.00ms | 52.00ms | 65.33ms |
| toNumber() | 16.67ms | 51.33ms | 46.00ms |
| Auto-cast | 40.00ms | 89.33ms | 178.00ms |

##### Base10Util(Opera 58.0.3135.65)
##### Parsed 500000 Strings
| | Length 1 | Length 10 | Length 16
|---|---|---|---|
| parseInt() | 15.00ms | 93.67ms | 247.33ms |
| toNumber() | 26.00ms | 59.00ms | 258.33ms |
| Auto-cast | 17.00ms | 106.33ms | 253.67ms |

##### Base10Util(NodeJS v8.10.0)
##### Parsed 500000 Strings
| | Length 1 | Length 10 | Length 16
|---|---|---|---|
| parseInt() | 13.00ms | 74.33ms | 179.67ms |
| toNumber() | 22.67ms | 71.67ms | 257.33ms |
| Auto-cast | 12.33ms | 81.33ms | 229.33ms |
Loading

0 comments on commit e538465

Please sign in to comment.