|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
518 bytes
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | // Note that we take code points as JS numbers, not JS strings.
|
|---|
| 4 |
|
|---|
| 5 | function isASCIIDigit(c) {
|
|---|
| 6 | return c >= 0x30 && c <= 0x39;
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | function isASCIIAlpha(c) {
|
|---|
| 10 | return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | function isASCIIAlphanumeric(c) {
|
|---|
| 14 | return isASCIIAlpha(c) || isASCIIDigit(c);
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | function isASCIIHex(c) {
|
|---|
| 18 | return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | module.exports = {
|
|---|
| 22 | isASCIIDigit,
|
|---|
| 23 | isASCIIAlpha,
|
|---|
| 24 | isASCIIAlphanumeric,
|
|---|
| 25 | isASCIIHex
|
|---|
| 26 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.